Skip to content

[Fix] Stringify torch.device annotations for Paddle - #4

Merged
SigureMo merged 1 commit into
paddle/kda-compactfrom
agent/stringify-torch-device-annotations
Jul 30, 2026
Merged

[Fix] Stringify torch.device annotations for Paddle#4
SigureMo merged 1 commit into
paddle/kda-compactfrom
agent/stringify-torch-device-annotations

Conversation

@huangjiyi

@huangjiyi huangjiyi commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stringify all 26 torch.device annotations under fla/ so Paddle compat does not resolve type hints through the proxied torch module. Runtime expressions and defaults, including torch.device("cpu") in prepare_split_cu_seqlens, remain unchanged. This targets the PaddleFleet PR #1578 wheel import failure in Actions job 90814641372.

Test plan

  • AST annotation audit: 26 sites across 12 files, UNQUOTED=0.
  • Direct Paddle compat import: passed.
  • tests/paddle/test_kimi_delta_attention.py: 6 passed, including dense/mask training forward/backward.
  • git diff --check: passed.

Benchmark / NCU

Not applicable; this changes type annotations only.

Breaking changes

None.

@huangjiyi
huangjiyi force-pushed the agent/stringify-torch-device-annotations branch from bc67ddf to 887c82f Compare July 30, 2026 12:45
@SigureMo
SigureMo merged commit 34c5385 into paddle/kda-compact Jul 30, 2026
1 check passed
@SigureMo
SigureMo deleted the agent/stringify-torch-device-annotations branch July 30, 2026 12:50
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.

2 participants