Skip to content

docs: load with placement=, not device_map= (removed in #6473) - #6530

Merged
Qubitium merged 1 commit into
mainfrom
docs/placement-not-device-map-6507
Dec 1, 2026
Merged

Qubitium merged 1 commit into
mainfrom
docs/placement-not-device-map-6507

Conversation

@Qubitium

@Qubitium Qubitium commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Since #6473, GPTQModel.load / from_pretrained / from_quantized raise TypeError for device_map= and the other Accelerate placement keywords. The DeepSeek-V4.1 docs still passed device_map="auto" in all three examples, and two multi-GPU paragraphs still recommended it. Those examples are in NOT_EXECUTED_BLOCKS because they download a 101B checkpoint, so the docs runner never caught the failure.

Fixes #6507

What Changed

  • docs/deepseek-v41-module-inventory.md: the three examples use placement="accel", and the prose describes placement= / Placement with a link to docs/weight-loader.md.
  • docs/multi_gpu_quantization.md: the two paragraphs that recommended device_map="auto" now point at placement=.
  • tests/test_docs_contract_refs.py:
    • test_doc_loader_examples_use_placement_not_device_map is a static AST guard over every Python block in docs/** and README.md, including skip-listed blocks. It rejects GPTQModel.load/from_pretrained/from_quantized calls that pass device_map, max_memory, offload_folder, offload_state_dict or offload_buffers.
    • test_gptqmodel_loaders_reject_accelerate_placement_kwargs (15 cases) checks that each loader really raises TypeError naming the keyword, so the guard stays tied to the public API.
    • The three edited blocks get refreshed skip-list digests.
  • Out of scope: docs/config-serialization.md and docs/checkpoint-owned-materialization.md still describe the pre-Remove accelerate: explicit WeightLoader for weight loading, placement and offload (#6471) #6473 from_quantized device_map resolution as mechanism history. Neither has a copyable example that calls the loader.

Tests

  • Unit tests have been executed and passed, or the reason they are not applicable is documented.
  • I added a new simple/fast unit test for this change, or documented why that is not applicable.

Red, on origin/main c649fcb docs with the new test:

cd tests && CUDA_VISIBLE_DEVICES="" python -m pytest test_docs_contract_refs.py -k "placement_kwargs or use_placement" -q
# 1 failed, 15 passed
# E docs/deepseek-v41-module-inventory.md block 0 line 3: GPTQModel.load(device_map=...)
# E docs/deepseek-v41-module-inventory.md block 1 line 4: GPTQModel.load(device_map=...)
# E docs/deepseek-v41-module-inventory.md block 2 line 5: GPTQModel.load(device_map=...)

Green, on this branch (CPU only, CUDA_VISIBLE_DEVICES=""):

cd tests && python -m pytest test_docs_contract_refs.py -q -k "not test_doc_python_example_runs"
# 229 passed, 31 deselected
cd tests && python -m pytest test_docs_contract_refs.py -q -k "test_doc_python_example_runs"
# 29 passed, 2 failed: supported-models.md::0 and thread-caps.md::1, both
# "docs block execution budget (240s) exhausted" on a heavily loaded shared host.
# Both pass in isolation (2 passed in 23.8s). This PR adds no executed blocks.
uvx [email protected] check gptqmodel gptqmodel/models/ports/native/auto/__init__.py gptqmodel/models/ports/native/auto/_registry.py docs/eora tests setup.py
# All checks passed!

I also checked that the replacement call works: GPTQModel.load(<Qwen1.5-0.5B-Chat>, placement="accel", quantize_config=QuantizeConfig(bits=4, group_size=128)) loads on a CPU-only host. The DeepSeek-V4.1 checkpoints themselves (101B) were not loaded, so that remains unverified.

Measured Impact

Not applicable (docs and test only).

Model Support / Module Plan

Not applicable.

Logic Flow Documentation

Not applicable: docs and test only, with no control-flow change.

Review Requirements

  • Reviewed this PR.
  • Checked that the code matches existing project structure, APIs, and conventions.
  • Avoided unnecessary monkeypatching and used the project's normal extension points where possible.
  • Minimized and compacted the impacted code surface.
  • Considered and eliminated potential regressions.

Kernel Accuracy Requirements

Not applicable.

Notes

Found during the release-readiness sweep. The removed keywords are a breaking change in the next release, so every copyable example should show placement=.

🤖 Generated with Claude Code

GPTQModel.load/from_pretrained/from_quantized raise TypeError for
device_map= since #6473, but the DeepSeek-V4.1 examples still passed it
and two multi-GPU paragraphs still recommended it. The examples are
skip-listed (101B download), so nothing executed them.

- Use placement="accel" in the three DeepSeek-V4.1 examples and refresh
  their NOT_EXECUTED_BLOCKS digests.
- Point the multi-GPU prose at placement= and docs/weight-loader.md.
- Add a static guard over every docs/README Python block (executed or
  skip-listed) that rejects Accelerate placement keywords on GPT-QModel
  loaders, plus a check that each loader really raises TypeError for
  each removed keyword.

Fixes #6507

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Qubitium
Qubitium marked this pull request as ready for review December 1, 2026 02:40
@Qubitium
Qubitium merged commit 803a008 into main Dec 1, 2026
6 checks passed
@Qubitium
Qubitium deleted the docs/placement-not-device-map-6507 branch December 1, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: DeepSeek-V4.1 and multi-GPU docs still pass device_map= to GPTQModel.load (TypeError since #6473)

1 participant