Add cuRANDDx Support#1198
Conversation
Greptile SummaryThis PR wires in cuRANDDx as a JIT-fusion backend for floating-point
Confidence Score: 5/5Safe to merge; the JIT path is cleanly opt-in (requires MATX_EN_MATHDX + MATX_EN_JIT + element count at most 1024) and falls back to the existing cuRAND path otherwise. All changes are additive and gated behind compile-time flags. The non-JIT code paths are untouched. The two flagged items are edge-case quality issues (NaN/Inf alpha serialisation and a silent fallthrough on a hypothetical future distribution), neither of which affects current correct behavior. include/matx/generators/random.h — specifically JITValueLiteral and the distribution dispatch inside the generated GenerateStandardScalar string. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["random<T>({N}, dist, seed).run(exec)"] --> B{Executor type?}
B -->|CUDAJITExecutor| C{CanUseJITRandom?}
C -->|Yes - float, 0 < N <= 1024| D["get_jit_op_str() - emit JITRandomOp struct via cuRANDDx"]
D --> E["NVRTC compiles fused kernel"]
E --> F["Per-thread Philox4-32: group=linear>>2, lane=linear&3"]
C -->|No| G{Direct assign? LHS is tensor_view}
B -->|cudaExecutor| G
G -->|Yes - contiguous| H["cuRAND fill bulk + tail"]
G -->|No - generic expr| I["PreRun: allocate values_ buffer, element-wise op()"]
H --> J[Result]
I --> J
F --> J
Reviews (5): Last reviewed commit: "Address Greptile random review feedback" | Re-trigger Greptile |
|
@greptile review |
|
@greptile-apps review |
f4b558b to
f304890
Compare
|
/build |
No description provided.