Skip to content

Commit 4513a51

Browse files
superbobryjax authors
authored andcommitted
The new Pallas GPU lowering now supports triton_params=
This allows including arbitrary serialized metadata in the emitted CustomCall op. PiperOrigin-RevId: 610696086
1 parent 1a16a43 commit 4513a51

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jax/_src/pallas/triton/pallas_call_registration.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class CompilationResult:
4646
lowering_result: lowering.LoweringResult
4747

4848

49-
5049
@util.weakref_lru_cache
5150
def compile_jaxpr(
5251
jaxpr: jax_core.Jaxpr,
@@ -193,9 +192,6 @@ def _pallas_call_ttir_lowering(
193192
num_warps: int,
194193
num_stages: int,
195194
):
196-
if triton_params:
197-
raise NotImplementedError("triton_params are not supported")
198-
199195
# TODO(sharadmv): handle multiple devices, right now we assume device 0
200196
# which is fine when we have multiple of the same GPU but this won't work in
201197
# general.
@@ -231,6 +227,11 @@ def _pallas_call_ttir_lowering(
231227
grid_z=mlir.i32_attr(grid_z),
232228
debug=ir.BoolAttr.get(debug),
233229
)
230+
if "serialized_metadata" in (triton_params or {}):
231+
# This field is unstable and may be removed in the future.
232+
backend_config["serialized_metadata"] = ir.StringAttr.get(
233+
triton_params["serialized_metadata"]
234+
)
234235
return mlir.custom_call(
235236
call_target_name="__gpu$xla.gpu.triton",
236237
result_types=out_types,

0 commit comments

Comments
 (0)