Conversation
c1bfff5 to
8b9c187
Compare
vadiklyutiy
left a comment
There was a problem hiding this comment.
It's worth to add unit tests
124370a to
c4f2c71
Compare
c4f2c71 to
8ccc0e0
Compare
Done. Tested in tests/model_executor/test_fp8_marlin_padding.py |
8ccc0e0 to
7435ce9
Compare
|
@claude review |
|
Hi @mikekg, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Thank you for flagging this. After rebasing, the files changed by this PR pass pre-commit; the remaining The failing line appears to have been introduced on main by PR #36949 ( How would you like me to proceed? My preference is to keep this PR focused and handle that unrelated pre-commit failure separately. The CI failures I inspected also appear unrelated to this PR’s diff. |
d406660 to
f0f0574
Compare
|
Hi @mikekg, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
FP8 and MXFP8 Marlin repack and GEMM require rank-local N/K extents that match a supported Marlin thread tile family. Padding everything to N64/K128 is valid but can overpad cases where the N128/K64 family is sufficient. Select the lower-overhead rank-local padded size from the two non-dominated tile families that are valid for both small and large batches: N multiple 128 with K multiple 64, or N multiple 64 with K multiple 128. Include the quantization group size in the K multiple when needed so block-scale layouts remain consistent. Use the selected extents consistently when repacking weights and scales and when launching the Marlin GEMM. Pad the activation K dimension with zeros, slice padded output columns after GEMM, and pad bias before Marlin bias permutation when bias is present. This padding is applied after tensor-parallel partitioning via output_size_per_partition and input_size_per_partition, so global checkpoint tensors are not expanded before TP slicing. Signed-off-by: Michael Gschwind <mgschwind@nvidia.com> Signed-off-by: Mike G <180722391+mikekg@users.noreply.github.com>
Signed-off-by: Michael Gschwind <mgschwind@nvidia.com> Signed-off-by: Mike G <180722391+mikekg@users.noreply.github.com>
f0f0574 to
b972963
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
|
This was merged into omnibus Marlin padding patch #45295 and the issue is now closed |
Purpose
FP8 and MXFP8 Marlin repack and GEMM require rank-local N/K extents that
match a supported Marlin thread-tile family.
A fixed padding rule can be valid but overpad some partitions. This change
selects the lower-overhead padded rank-local extent from the two Marlin tile
families that are valid for both small and large batches:
The padding is applied after tensor-parallel partitioning, so global
checkpoint tensors are not expanded before TP slicing.
Changes
Test Plan
Run Nemotron 3 Super 120B NVFP4 with TP4 on A100. This exercises the
dense FP8 Marlin path that failed in
gptq_marlin_repack().Repro vllm serve command:
Test Result
Before this change, the TP4 A100 run failed during dense FP8 Marlin repack:
Selected MarlinFP8ScaledMMLinearKernel
RuntimeError: size_n = 4640 is not divisible by tile_n_size = 64
With this change, the dense FP8 Marlin repack failure no longer occurs. The
same run progressed past the FP8 dense path and then exposed a separate NVFP4
MoE Marlin padding issue:
RuntimeError: size_n = 672 is not divisible by tile_n_size = 64
That later failure is in the NVFP4 MoE path and is separate from the dense
FP8 Marlin padding fixed here. It is addressed by #43908.
After applying both the present PR and #43908, the TP4 NVFP4 serve sanity run completed successfully with Nemotron 3 Super:
TEST=nemo3super
MODEL_REPO=nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4
TP=4
QUANTIZATION=modelopt
server ready after 245s
...
Job Complete - Exit code: 0
This also requires #42610 to pass FP4 weights between Marlin operators when torch.compile() creates compiled execution paths.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.