Repository navigation
feat(utils): add once-per-message logger methods - #858
Merged
Merged
Conversation
debug_once / info_once / warning_once log on rank 0, once per distinct message and args. select_kernel, which logged its choice once per layer, and the hand-rolled log-once guards now use them.
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
Loading a quantized checkpoint prints the kernel choice once per layer:
select_kernelruns for every layer'sQuantMethodand logs each time.nvidia/Qwen3.6-35B-A3B-NVFP4(ModelOpt mixed precision, W4A16_NVFP4 experts) prints 121 lines with only 2 distinct messages:This adds
debug_once,info_onceandwarning_onceto the loggersinit_loggerreturns, following vLLM'slogger.info_once(default scope "local"): rank 0 only, once per distinct (logger, level, msg, args) in the process. The seen set is module-level becauseinit_loggerrebuilds a logger's methods on every call for the same name. Args must hash by value, as with vLLM'slru_cachekey.Moved onto it:
layers/quantization/method.py:select_kernel.layers/quantization/moe/nvfp4.py: the "installed but unusable" warnings of the marlin and b12x symbol checks, whichunusable_reasonruns for every MoE layer.layers/quantization/linear/nvfp4.py:_warn_part_globals(functools.cache+warning_rank0) removed.models/gguf/mmproj.py:_warn_inline_vision(functools.cacheper model path) removed.models/minimax_m3/config.py:_log_mode_onceand_LOGGED_MODESremoved.models/qwen3_vl/vision.py: the_warned_rope_fallbackflag removed.These lines now log on rank 0 only; before, the minimax, mmproj, qwen3_vl and MoE symbol-check lines logged on every rank.
Left as they are, since they suppress differently:
scheduler.py_warned_cut_image(first warning only, the text varies per image),server/request_logger.py_warn_once(one flag for every message),moe/offload_cache.pyhit-d2d flag (re-arms after a rebuild).Tests
ft serve --model nvidia/Qwen3.6-35B-A3B-NVFP4 --port 30112(local copy): 121kernel ... selectedlines on main 9cacd08, 2 on this branch.pytest -m "not slow" tests/models/test_quant_config.py tests/models/test_minimax_m3.py tests/models/test_minimax_m3_vision.py tests/models/test_qwen3_vl.py tests/models/test_qwen3_vl_vision.py tests/models/qwen4_exp/test_skeleton.py tests/models/test_gemma4_gguf_rope.py tests/models/test_models_registry.py tests/kernels/test_nvfp4_w4a4_linear.py tests/kernels/test_e4m3_compat.py tests/moe: 393 passed, 50 skipped, 8 failed; the same 8 fail on main 9cacd08 (7 intest_quant_config.pyfrom local checkpoints whose quant dialect differs from the HF repo the case names, or index-only MiniMax-M3-NVFP4 snapshots; 1 intests/moe/test_nvfp4_backends.py::test_w4a4_prefill_matches_nvfp4_activation_reference[512-1024-swiglu_clamp-256], which passed in an earlier run on both).