For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo module
nan_check
NaN/Inf detection kernels for the max-debug.nan-check feature.
These kernels are registered as custom ops in the kernels package and
inserted by the NanCheckPass compiler pass. The architecture is:
-
nan_check_count: read-only reduction that counts NaN/Inf values in a floating-point tensor. Outputs two single-element int32 tensors with the counts. CPU: vectorized scan with atomics. GPU: parallel reduction.
-
nan_check_raise: host-side kernel that reads the NaN/Inf counts (transferred to host via mo.transfer for GPU graphs) and raises a diagnostic error if any are non-zero.
Functionsโ
- โ
nan_check_count: Counts NaN/Inf values in a floating-point tensor. - โ
nan_check_raise: Raises an error if NaN or Inf counts are non-zero.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!