Skip to content

fix(lora): honor --attention-backend in the bridge LoRA path - #1915

Merged
yushengsu-thu merged 1 commit into
mainfrom
fix/lora-attention-backend
Jul 28, 2026
Merged

fix(lora): honor --attention-backend in the bridge LoRA path#1915
yushengsu-thu merged 1 commit into
mainfrom
fix/lora-attention-backend

Conversation

@yushengsu-thu

@yushengsu-thu yushengsu-thu commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

LoRA runs silently ignore --attention-backend: _setup_lora_model_via_bridge never copies it onto the provider, unlike model_provider.py:78. Megatron maps that field to the NVTE_*_ATTN vars, so the dropped value let TE pick a backend the caller had opted out of — which is why test_lora_qwen2.5_0.5B.py dies in the fused-attention backward on main nightly.

Honoring it makes one previously inert request take effect. gpt-oss runs with --softmax-type learnable, where TE 2.17 disables FlashAttention outright and reports no fused kernel, leaving UnfusedDotProductAttention as the only option; its CI test asked for fused, so it now asks for auto.

Copilot AI review requested due to automatic review settings July 28, 2026 18:31
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread miles/backends/megatron_utils/bridge_lora_helpers.py Outdated
@yushengsu-thu
yushengsu-thu force-pushed the fix/lora-attention-backend branch from 5ec7a7f to 80df936 Compare July 28, 2026 20:49
_setup_lora_model_via_bridge copied ~20 args onto the provider but not
attention_backend, unlike model_provider.py. Megatron maps that field to
NVTE_FLASH_ATTN/NVTE_FUSED_ATTN/NVTE_UNFUSED_ATTN, so the dropped value
let TE pick a backend the caller had opted out of, which is what breaks
test_lora_qwen2.5_0.5B.py in the fused-attention backward.

Honoring it makes one previously inert request take effect: gpt-oss runs
with --softmax-type learnable, where TE 2.17 disables FlashAttention
outright and reports no fused kernel, leaving UnfusedDotProductAttention
as the only option. Its CI test asked for fused, so ask for auto instead.

@guapisolo guapisolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@guapisolo

Copy link
Copy Markdown
Collaborator

let's wait for CI pass and then merge

@yushengsu-thu
yushengsu-thu enabled auto-merge (squash) July 28, 2026 22:07
@yushengsu-thu
yushengsu-thu disabled auto-merge July 28, 2026 22:55
@yushengsu-thu
yushengsu-thu enabled auto-merge (squash) July 28, 2026 22:55
@yushengsu-thu

Copy link
Copy Markdown
Collaborator Author

@guapisolo passed

@yushengsu-thu
yushengsu-thu merged commit 6ccdc7d into main Jul 28, 2026
40 checks passed
@yushengsu-thu
yushengsu-thu deleted the fix/lora-attention-backend branch July 28, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants