Skip to content

Give the HF bridge an explicit per-layer handoff for deferred GPTQ zero points #6455

Backlog

Description

@devin-ai-integration

Where the fixes intersect

The HF bridge chooses a GPTQ kernel before Transformers resolves placement. For a legacy symmetric checkpoint it can also omit the packed zero points (qzeros) from the expected keys and regenerate them later. Those decisions were correct in isolation but interacted in three ways:

Landed fix What the next stage needed to know
#6409 after #6274 A 32-aligned legacy projection already has the current width. Accelerate dispatch runs before Optimum post-init and needs the ordinary checkpoint tensor available.
#6391 after #6253 A meta placeholder for a deferred zero point can coexist with resident CPU weights and no offload hook. AUTO still needs a CPU-capable kernel.
#6395 Replacing Marlin's class can leave its tile-shaped parameter on a portable kernel that decodes a standard packed buffer. The replacement needs its own shape, registration and runtime layout.

At the audited revision the constructor sets the per-layer deferral flag, reselection preserves it across a class change, and the materializer inspects the surviving registration and kernel class to decide what to build. A new backend must reproduce that agreement across all three stages. The cases above have fixes on main. Constructor · Post-init order · Materialization

Proposed handoff

  1. Let the package-owned GPTQ loader record one per-layer decision about the checkpoint words when geometry and producer metadata are known: load them, regenerate a recoverable symmetric tail, or reject a lost asymmetric tail. Use that decision for expected-key visibility. A meta tensor alone conveys no placement information.
  2. Carry that decision through AUTO selection. Use the resolved map, execution hook and primary packed weight for placement. Let the final kernel own how it installs a regenerated midpoint, including its packed shape, layout and buffer or parameter registration. Reuse the current layout and packing helpers. Marlin can keep its implicit midpoint where its representation supports it.
  3. Consume the pending regeneration once before the final kernel's post-init reads it. For an unsupported truly offloaded floor-width layer, report the layer and required resident placement at the earliest package-owned boundary that knows the placement. Keep matching-width layers on the ordinary dispatch path.

Migrate the legacy symmetric HF path first, using the existing package-owned constructor, reselection and post-init entry points. Scope the decision to one load and layer. Preserve checkpoint bytes, existing Accelerate hooks and the published v1/v2 layouts. No dependency patches or new serialized markers are needed.

Acceptance tests

  • With the same 4-bit producer metadata, use output widths 128 and 112. The first exposes its on-disk tensor before dispatch. The second regenerates the packed midpoint on a supported resident layer. A genuinely truncated asymmetric tail raises.
  • Force a resident CPU AUTO fallback with a deferred placeholder. Verify the replacement's registration, decode its words independently, and check the first forward against known weights. Exercise the retained Marlin path on supported NVIDIA hardware.
  • Exercise a real mixed map with a matching-width layer and check its first forward. Keep the truly offloaded, truncated case as a rejection control. Re-entering zero-point materialization after success must leave the words unchanged.

@Qubitium

Activity

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