Skip to content

feat(cambricon): enable MLU590 flash varlen via InfiniCore bump - #642

Merged
wooway777 merged 1 commit into
mainfrom
feat/cambricon-mlu590
Dec 4, 2026
Merged

wooway777 merged 1 commit into
mainfrom
feat/cambricon-mlu590

Conversation

@wooway777

@wooway777 wooway777 commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Bump third_party/InfiniCore from b350edf6 to 63197c5e.
  • 63197c5e contains the merged Cambricon CNNL flash attention varlen provider (InfiniOps d552d996, InfiniCore #1590).
  • No InfiniLM source changes are required: the provider is selected by the Cambricon operator profile at InfiniOps build time.

Motivation

Enables the Cambricon MLU590 InfiniLM workflow for Qwen3 dense inference. The CNNL-backed FlashAttnVarlenFunc provider lives in InfiniOps and is pulled in through InfiniCore; InfiniLM only needs to track the InfiniCore revision that contains it.

A generic dtype pass-through from BaseConfig/EngineConfig/LLM into InferEngine was tested and intentionally reverted. Qwen3-0.6B's checkpoint already declares torch_dtype: bfloat16, and the Cambricon BF16 path passes without overriding it. Forcing dtype from the top would change the default dtype behavior on every platform, so this PR does not include that change.

No linked issue.

Type of Change

  • feat — new feature / new model
  • fix — bug fix
  • perf — performance improvement (no behavioral change)
  • refactor — code restructuring without behavior change
  • test — adding or fixing tests only
  • docs — documentation only
  • build / ci — build system or CI configuration
  • chore — tooling, formatting, or other non-code changes
  • Breaking change

Test Results of Involved Models on Supported Platforms (Please attach screenshots)

Platform Model Test Result
Cambricon MLU590 Qwen3-0.6B examples/test_infer.py single request, BF16 Passed; 28 FlashAttnVarlenFunc calls in prefill; valid response; ~417 ms
NVIDIA N/A - not affected N/A N/A
MetaX N/A - not affected N/A N/A
Moore N/A - not affected N/A N/A
Ascend N/A - not affected N/A N/A

Cambricon command:

export MLU_VISIBLE_DEVICES=0
export INFINI_OPS_TRACE_CALLS=1
/torch/venv3/pytorch_training/bin/python examples/test_infer.py \
  --device cambricon --backend cpp \
  --model /data-aisoft/mechdancer/models/Qwen3-0.6B \
  --dtype bfloat16 --batch-size 1 --max-cache-len 512 \
  --max-new-tokens 8 --top-k 2 --top-p 1.0 \
  --prompt '你好,请用一句话介绍我自己。' --log-level WARNING

Trimmed output:

===Response===
<think>
好的,用户让我用一句话

total_time: 416.79 ms

INFINI_OPS_TRACE_CALLS=1 showed 28 FlashAttnVarlenFunc calls and zero FlashAttnWithKvcache calls.

Benchmark / Performance Impact

N/A — dependency bump only; no performance claim.

Notes for Reviewers

  • 63197c5e is the InfiniCore main commit that contains the merged InfiniOps d552d996 Cambricon CNNL flash varlen provider.
  • The Cambricon operator profile is maintained outside the repository and is not part of this PR.
  • The dtype pass-through was intentionally reverted; see Motivation.
  • No InfiniLM C++ or Python source is changed by this PR.

CI / ChatOps

CI has not been triggered from this environment. Please run /retest or trigger the CI workflow on feat/cambricon-mlu590.


Checklist

Title, Branch, and Commits

  • PR title follows Conventional Commits.
  • Branch name follows <type>/xxx-yyyy-zzzz (feat/cambricon-mlu590).
  • Each commit message follows Conventional Commits.
  • Small PR is a single squashable commit.
  • No stray merge commits from main.
  • No fixup! / squash! / wip commits remain.
  • N/A — Existing PR/branch/commit that followed the legacy issue format.

Scope and Design

  • Changes are minimal — only the InfiniCore submodule pin.
  • No dead code, commented-out blocks, debug prints, or TODOs.
  • No unrelated formatting churn.
  • N/A — Public API changes: no InfiniLM source or API changes.

General Code Hygiene

  • N/A — No source files changed; the only change is the submodule pointer.

C++ Specific

  • N/A — No C++ files changed.

Python Specific

  • N/A — No Python files changed.

Testing

  • Passed single request test (examples/test_infer.py) on Cambricon MLU590.
  • N/A — Offline performance, sanity, and service tests were not run; this PR only bumps a submodule pin and does not change InfiniLM runtime code.
  • For any platform that could not be tested, an explicit reason is given in the table.

Build, CI, and Tooling

  • The project builds cleanly on Cambricon MLU590.
  • CI has been triggered manually (Actions → CI on this branch), or /retest was requested. Not triggered from this environment; please /retest.

Documentation

  • N/A — No user-visible InfiniLM behavior or build flags changed; the Cambricon workflow doc is maintained outside the repository.

Security and Safety

  • No secrets, access tokens, internal URLs, customer data, or personal hardware identifiers have been committed.
  • Third-party code is license-compatible and attributed.
  • No unsafe pointer arithmetic, uninitialized reads, or missing bounds checks were introduced.

@wooway777
wooway777 requested a review from a team December 4, 2026 06:29
Pin InfiniCore to 63197c5e, which contains the merged Cambricon CNNL flash attention varlen provider. No InfiniLM source changes are required; the provider is selected by the Cambricon operator profile at build time.
@wooway777
wooway777 force-pushed the feat/cambricon-mlu590 branch from 6c32028 to b279168 Compare December 4, 2026 07:02
@wooway777 wooway777 changed the title Feat/cambricon mlu590 feat(cambricon): enable MLU590 flash varlen via InfiniCore bump Dec 4, 2026
@wooway777
wooway777 merged commit 7dd2921 into main Dec 4, 2026
10 checks passed
@wooway777
wooway777 deleted the feat/cambricon-mlu590 branch December 4, 2026 07:22
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