Skip to content

[BUG] Default GPTQModel.load(path) always fails on mixed compute-capability multi-GPU hosts (4090+5090): device map spans every visible GPU (#4632 fixed only max_memory) #4705

Closed

Description

@Qubitium

Found on main @ 12c1273, host with an RTX 4090 (sm_89) and an RTX 5090 (sm_120). Follow-up to #4632, whose fix (#4637) covered only the max_memory= path.

What is wrong

On a host where the visible GPUs have different compute capabilities, the plainest call, GPTQModel.load(path) with no device, device_map or max_memory, always raises. That happens even for a 1B model that fits easily on one card. The default placement expands the CUDA family to every visible GPU (_resolve_default_layerwise_device → expand_selector_device_family, models/loader.py). Kernel selection then refuses the mixed-architecture device map. The error doesn't tell the user how to proceed.

Repro

# CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES=0,2   (cuda:0 = RTX 4090, cuda:1 = RTX 5090)
from gptqmodel import GPTQModel, BACKEND
m = GPTQModel.load("Llama-3.2-1B-Instruct-GPTQ-4bits-gp128", backend=BACKEND.AUTO)
ValueError: Quantized kernel selection does not support a device map spanning different GPU compute capabilities: cuda:0=8.9, cuda:1=12.0.

The same call with only one GPU visible (CUDA_VISIBLE_DEVICES=0) loads on cuda:0 with MarlinLinear and generates "The capital of France is Paris." An explicit device="cuda:0" also works. Only the default path is unusable.

Suggested fix

  1. When the default placement fits on one device, place it on a single device (or within one compute-capability group) instead of spanning every visible GPU. Alternatively, pick kernels per device group, if a mixed map is meant to be supported.
  2. At minimum, make the refusal actionable: name the devices and suggest device="cuda:N", max_memory={N: ...} or CUDA_VISIBLE_DEVICES.
  3. Add a CPU-mocked test for the default (no device / no max_memory) path on a mixed-capability topology, next to fix(loader): validate kernels against the max_memory devices, not every GPU (#4632) #4637's max_memory test.

Severity: medium. Mixed-generation multi-GPU hosts are common, and the default load is the first thing users try.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Claimed by an AI agent. Will reproduce on CPU with mocks where the hardware is unavailable, fix, add a focused regression test, and open a PR.

  2. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-53ba17eb4d83 finished this issue.

    Pull request: #4714

    Finishing the mixed-capability default-placement fix and its regression tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions