Skip to content

native RHT lora import#205

Draft
ry2009 wants to merge 4 commits intomainfrom
rht-import
Draft

native RHT lora import#205
ry2009 wants to merge 4 commits intomainfrom
rht-import

Conversation

@ry2009
Copy link
Copy Markdown

@ry2009 ry2009 commented Apr 9, 2026

Loads QLoRA checkpoints from mirai-gpu's RHT (right-hand transposed) format without any monkeypatching.

  • QLoRALinear.import_weights unwraps the inner_linear wrapper key present in RHT checkpoints
  • _structure_linear_config hook strips RHTLinearWrapperConfig from the config JSON, resolving the inner type dynamically
  • Fix QLoRALinearConfig._empty_general infinite recursion (was calling super().empty() which re-entered via polymorphic dispatch)
  • Drop the redundant QLoRALinearConfig.empty() override — base class already dispatches empty()self._empty_general((), ...)

Tested against models/ungodly-lora-r16 on gup — model loads and runs.

ry2009 added 4 commits April 9, 2026 17:54
super().empty() dispatched back to self._empty_general(), looping forever.
Call super()._empty_general() directly to hit GroupQuantizedLinearConfig.
Base GroupQuantizedLinearConfig.empty() already dispatches to
self._empty_general((), ...) — the override was calling super().empty()
which polymorphically re-entered _empty_general and broke the assert.
@knyazer knyazer marked this pull request as draft April 10, 2026 11:32
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.

1 participant