Repository navigation
fix(backend): keep resolved policy out of QuantizeConfig.kernel; apply every pool setting (#4446, #4448, #4449) - #4497
Merged
Conversation
…y every pool setting (#4446, #4448, #4449) #4446: resolve_quantize_backend stored its generated policy in QuantizeConfig.kernel, so a reused config raised "legacy kernel= cannot be supplied together" for typed backends and runtime=, and an enum selection re-applied the previous typed settings. The derived policy now lives in the private _resolved_kernel; kernel/runtime only hold caller settings. A legacy kernel conflicts with a typed backend or runtime wherever each was supplied, so QuantizeConfig.runtime + kernel= now raises instead of dropping runtime. load/from_pretrained forward the caller's arguments to the model definition; every config's quant_linear_init_kwargs uses resolve_kernel_config. #4448: resize_device_thread_pool compares (cpu_workers, cuda_workers, pool_intraop_threads) and rebuilds on any change. RuntimeConfig gains pool_intraop_threads and BitsAndBytesConfig gains triton. AWQ Marlin honours MarlinConfig(fp32=...); GGUFCUDAConfig drops options ggml-cuda never read. KernelConfig rejects unknown rocm_quant_blas spellings. Retired env vars are re-checked at each load. Concrete config classes lift meta-held fields from their own to_dict() payload. #4449: GGUF_CPP test uses GGUFCPPConfig instead of the retired env var; docs fixed (GGUF exact path, RDNA4 hipBLASLt recipe, invalid shell line, PAROQUANT_CUDA); device=<int> beyond the visible devices raises ValueError. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #4446
Fixes #4448
Fixes #4449
#4446: the resolved policy is no longer written into
QuantizeConfig.kernelresolve_quantize_backend(gptqmodel/utils/backend_config.py:265-278at 489aed6) stored the policy it generated inqcfg.kernel. The next call read it back as a legacykernel=supplied by the caller.qcfg._resolved_kernel.qcfg.kernelandqcfg.runtimehold only settings the caller supplied. The loader'skernel=/runtime=replace the field of the same kind, after validation.QuantizeConfig.runtime+kernel=now raises instead of silently dropping the runtime.resolve_kernel_configchecks_resolved_kernel>kernel>runtime> process default.GPTQModel.loadandfrom_pretrainedforward the caller's own arguments to the model definition; resolving them again is idempotent.from_quantizedredirects keep the already-resolved pair.quant_linear_init_kwargsusesresolve_kernel_config(self).QuantizeConfig(runtime=R), thenbackend=TorchConfig(...)(load or quantize)runtime=R1, thenruntime=R2TorchConfig(streaming=True), thenBACKEND.TORCHQuantizeConfig(runtime=R)+kernel=Kflowchart TD A["resolve_quantize_backend"] --> I{"inherit and AUTO?"} I -- yes --> T["qcfg._backend_config"] I -- no --> S T --> S["effective kernel = arg or qcfg.kernel<br/>effective runtime = arg or qcfg.runtime"] S --> C{"kernel with typed backend or runtime?"} C -- yes --> F["ValueError naming each source; nothing recorded"] C -- no --> P["resolve_backend_config"] P --> W["record caller args; _backend_config; _resolved_kernel"] classDef failure fill:#ffe0e0,stroke:#b00,color:#600 class F failure#4448
resize_device_thread_poolcompares(cpu_workers, cuda_workers, pool_intraop_threads)and rebuilds the pool on any change. On CUDA,cuda:0workers 1 → 3 is now applied; before, it stayed at 1.RuntimeConfig.pool_intraop_threadsandBitsAndBytesConfig(triton=).torch_cache_weightsandtorch_lookaheadstay unexposed, because they are compatibility shims that were refused.MarlinConfig(fp32=). Default logits are bitwise unchanged, andfp32=Falsenow differs (max 0.039).fp32=False.GGUFCUDAConfigdrops the options ggml-cuda never read.KernelConfig.rocm_quant_blasrejects unknown spellings.GPTQConfig(**cfg.to_dict())keepstrue_sequential,damp_percent,offload_to_diskandpack_impl.#4449
GGUFCPPConfig(native_matmul=...)instead of the retired env var.QuantizeConfig.runtime;PAROQUANT_CUDA.device=<int>beyond the visible devices now raises a clearValueError.Tests
tests/test_backend_config_reuse_4446.py;tests/test_runtime_config_4448.py;tests/test_layerwise_device_placement.py;rocm_quant_blasrejection intests/test_rocm_quant_tuning.py.tests/test_thread_pool_exit.py.test_moe_config×4,test_excluded_device_warmup×3,test_rocm_backend_gating×1) also fail on main.🤖 Generated with Claude Code