Skip to content

Ascend: opt-in eager bootstrap for Torch 2.6/Triton 3.5 on ARM64 - #16279

Draft
SunXT-0719 wants to merge 1 commit into
unslothai:mainfrom
SunXT-0719:fix/ascend-eager-bootstrap
Draft

SunXT-0719 wants to merge 1 commit into
unslothai:mainfrom
SunXT-0719:fix/ascend-eager-bootstrap

Conversation

@SunXT-0719

Copy link
Copy Markdown

Cold-importing Unsloth on Linux ARM64 with Torch 2.6 and Triton 3.5 can fail while torch_npu imports Inductor's removed AttrsDescriptor API. Add an explicitly opt-in eager bootstrap before upstream optional probes import Torch.

The helper uses Inductor's existing no-Triton metadata fallback only while registering torch_npu, then restores the prior Triton module entry, including on failure. It requires all three flags below, is limited to Linux ARM64 / Torch 2.6 / Triton 3.5, and leaves already initialized processes alone.

UNSLOTH_ASCEND_EAGER_BOOTSTRAP=1 \
TORCH_COMPILE_DISABLE=1 \
UNSLOTH_COMPILE_DISABLE=1 \
python -c 'import unsloth'

Related to #10772 and the contribution-process question. This draft asks whether the narrow workaround should live in Core, move to Zoo, or be handled through vendor-stack installation guidance. It does not add a complete Ascend backend or claim PTO speedups.

Validation:

  • 12 CPU-only regression tests passed: opt-in/default policy, platform/version gates, compile settings, initialized processes, import-state restoration and visible vendor failures.
  • Official pinned Ruff formatter, project lint rules and git diff --check passed.
  • Actual Ascend910_9362 NPU: Qwen2.5-0.5B BF16, FP32 LoRA (rank/alpha 8, q/k/v/o projections), 117 input tokens, forward/backward and AdamW update passed. Loss was 1.3645132780075073; all 192 trainable tensors received gradients, and 96 changed on the first update.
  • Hardware environment: Linux aarch64, Python 3.11, Torch 2.6.0+cpu, torch_npu 2.6.0.post3, Triton 3.5.1, Transformers 4.56.2 and PEFT 0.18.0. Core was pinned to caf0a3bb7a9429c4390c4c42d8ef257f95437b54; unmodified Zoo was pinned to e2bef95e9077e5707919fbc057f1e51f3b7e565a (2026.10.11).

Hardware validation covers this eager-only configuration; CUDA/XPU hardware and compiled NPU execution were not tested. Prepared with AI assistance and local regression/hardware validation.

This branch has not been deployed

No deployments
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.

2 participants