jax.experimental.pallas.mosaic_gpu.InterpretGPUParams#

class jax.experimental.pallas.mosaic_gpu.InterpretGPUParams(*, detect_races=False, on_race='raise', out_of_bounds_reads='raise', skip_floating_point_ops=False, uninitialized_memory='nan', num_cores_or_threads=1, vector_clock_size=None, logging_mode=None, num_tma_threads_per_device=5, inline_mgpu='error')[source]#

Parameters for GPU interpret mode.

GPU interpret mode is a way run Pallas GPU kernels on CPU, while simulating a GPU’s shared memory spaces (GMEM, SMEM, etc.), threads and synchronization operations (e.g. barriers). This mode is intended for debugging and testing.

To run a kernel under GPU interpret mode, pass an instance of InterpretParams as an argument for the interpret parameter of pallas_call(), core_map() or kernel().

NOTE: If an exception is raised while interpreting a kernel, you must call reset_gpu_interpret_mode_state() before using GPU interpret mode again in the same process.

Parameters:
  • detect_races (bool)

  • on_race (Literal['raise', 'warn'])

  • out_of_bounds_reads (Literal['raise', 'uninitialized'])

  • skip_floating_point_ops (bool)

  • uninitialized_memory (Literal['nan', 'zero'])

  • num_cores_or_threads (int)

  • vector_clock_size (int | None)

  • logging_mode (LoggingMode | None)

  • num_tma_threads_per_device (int)

  • inline_mgpu (str)

num_tma_threads_per_device#

The number of threads that can be used for simulating memory transfers with the TMA unit. The interpreter does not in fact spawn separate threads for executing TMA memory transfers, but a separate vector clock is maintained for each TMA thread. Default: 1.

Type:

int

logging_mode#

Logging mode for GPU interpret mode.

Type:

jax._src.pallas.mosaic.interpret.params.LoggingMode | None

inline_mgpu#

control how interpret mode handles inline MGPU usage. Either “error” or “ignore”, since in general it’s not possible to simulate MGPU behavior in interpret mode. Default: “error”.

Type:

str

__init__(*, detect_races=False, on_race='raise', out_of_bounds_reads='raise', skip_floating_point_ops=False, uninitialized_memory='nan', num_cores_or_threads=1, vector_clock_size=None, logging_mode=None, num_tma_threads_per_device=5, inline_mgpu='error')#
Parameters:
  • detect_races (bool)

  • on_race (Literal['raise', 'warn'])

  • out_of_bounds_reads (Literal['raise', 'uninitialized'])

  • skip_floating_point_ops (bool)

  • uninitialized_memory (Literal['nan', 'zero'])

  • num_cores_or_threads (int)

  • vector_clock_size (int | None)

  • logging_mode (LoggingMode | None)

  • num_tma_threads_per_device (int)

  • inline_mgpu (str)

Return type:

None

Methods

__init__(*[, detect_races, on_race, ...])

get_vector_clock_size(num_devices)

Returns the number of vector clocks to use for TPU interpret mode.`

Attributes

detect_races

inline_mgpu

logging_mode

num_cores_or_threads

num_tma_threads_per_device

on_race

out_of_bounds_reads

skip_floating_point_ops

uninitialized_memory

vector_clock_size