Skip to content

Commit

Permalink
[Cherrypick] use env to skip PJRT initialize (#8609) (#8618)
Browse files Browse the repository at this point in the history
  • Loading branch information
zpcore authored Jan 23, 2025
1 parent 728f14d commit a501088
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch_xla/experimental/custom_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ def trace_pallas(kernel: Callable,
return trace_pallas_arg_to_payload[hash_key], tensor_args

# Here we ignore the kwargs for execution as most of the time, the kwargs is only used in traced code.
os.environ['SKIP_MEGASCALE_PJRT_CLIENT'] = 'true'
ir = jax.jit(
kernel, static_argnums=static_argnums,
static_argnames=static_argnames).lower(*jax_args, **kwargs).compiler_ir()
payload = _extract_backend_config(ir)
os.environ.pop('SKIP_MEGASCALE_PJRT_CLIENT', None)

if use_cache:
# if we reach here it means we have a cache miss.
Expand Down

0 comments on commit a501088

Please sign in to comment.