feat(phyai-kernel): add Thor NVFP4 GeGLU kernel for pi0.5 - #56
Draft
Aharrypotter wants to merge 1 commit into
Draft
Aharrypotter wants to merge 1 commit into
Aharrypotter wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Aharrypotter
force-pushed
the
codex/pi05-thor-mlp-product
branch
from
August 21, 2026 17:13
16834ac to
e44875c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This Draft PR adds an opt-in SM110 NVFP4 Gate+Up+GeGLU kernel for the fixed
pi0.5 language MLP shapes. The kernel fuses the merged gate/up projection,
GeGLU fold, and compact NVFP4 output store. Its output can feed the existing
NVFP4 down projection without a BF16 intermediate or a separate quantization
launch.
The compact epilogue is implemented in phyAI against CUTLASS callback
interfaces. The PR does not vendor, include, or depend on FlashRT source.
This is a low-level kernel API. It does not change pi0.5 model dispatch, weight
loading, conversion, or the default
DenseMLPpath.Review map
phyai_kernel/cuda/pi05_thor_nvfp4_geglu.pydefines the public contract,fail-closed validation, caller-owned buffers, SM110 guard, and JIT build.
cuda/csrc/pi05_thor_nvfp4_geglu.cuhcontains the fixed128x256x256tile,1x2x1cluster schedule, and TVM-FFI boundary.cuda/csrc/pi05_thor_nvfp4_geglu_epilogue.cuhimplements the phyAI-ownedGeGLU fold, per-block scale generation, packed E2M1 store, and CUTLASS
fusion callback.
tests/test_pi05_thor_nvfp4_geglu.pycovers the shape and storage contract,numerical comparison, failure paths, and CUDA Graph capture.
benchmark/bench_pi05_thor_nvfp4_geglu.pydefines the matched stagedbaseline and raw-sample timing protocol.
Supported contract
M in {784, 816, 880, 968},K=2048, mergedN=32768, hiddenH=16384gate0, up0, gate1, up1, ...Numerical checks compare the consumed down-projection result with the staged
NVFP4 path. The frozen gate is relative-L2 below 0.05 and cosine above 0.999.
Validation
Current product commit:
e44875cce92374002339164b123624cb9295fc35.The current source contains no FlashRT vendored file or include. The first
published Draft revision did, and its performance and model screens are no
longer used as current-source evidence.
Performance evidence
Evidence boundary: performance qualification is pending an uncontended Thor
window. Two unrelated GPU-resident policy servers are active on the shared
device, so their timing is excluded from the PR claim.
Setup: the checked-in benchmark freezes the intended run contract. Timing
is reported in ms.
quantization.
interleaved weight, and end with packed NVFP4 hidden activation and scales.
Results in milliseconds, per-shape speedups, the primary geometric mean, and
the worst row will be added after the current source passes that full matrix.
The 18-layer checkpoint workset and temporary model integration screen will
also be rerun before this Draft is promoted.
Files changed
header.
The PR contains 7 changed files with 1,063 additions and 1 deletion.
Experimental harnesses, generated artifacts, model weights, rejected schedules,
and model integration patches are excluded.
Known limits
copy bundled with FlashInfer.
caller-owned workspace and output buffers.
included. Unsupported contracts fail closed and the existing MLP path is
unchanged.
not calibrated model-quality or task-quality evidence.
18-layer MLP, and temporary model integration performance screens.