Skip to content

fix(deepseek): follow pypto-lib kernel dir rename v4 -> v4-flash - #108

Draft
lwDavid wants to merge 2 commits into
hw-native-sys:mainfrom
lwDavid:adapt/dsv4-kernel-path-v4-flash
Draft

fix(deepseek): follow pypto-lib kernel dir rename v4 -> v4-flash#108
lwDavid wants to merge 2 commits into
hw-native-sys:mainfrom
lwDavid:adapt/dsv4-kernel-path-v4-flash

Conversation

@lwDavid

@lwDavid lwDavid commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Follows the pypto-lib kernel-directory rename models/deepseek/v4models/deepseek/v4-flash (pypto-lib splits the variant into v4-flash + v4-pro; v4-flash is the serving/W8A8 variant). Without this, serving's DeepSeekV4 startup fails with FileNotFoundError: Cannot locate DeepSeekV4 kernels.

Changes

pypto_serving/model/deepseek/npu_executor.py (3 lines, path component only):

  • _find_pypto_lib_deepseek_v4_dir — both candidate paths (PYPTO_ROOT/models/deepseek/v4 and <checkout>/pypto-lib/models/deepseek/v4) → .../v4-flash.
  • _is_deepseek_v4_module_file — the ("models", "deepseek", "v4") parts check → ("models", "deepseek", "v4-flash").

Function names keep the deepseek_v4 model-family identifier — only the filesystem path component moves, matching how the qwen discovery (models/qwen3/14b) is hardcoded.

Why it's safe

The unit tests monkeypatch _find_pypto_lib_deepseek_v4_dir (tests/test_deepseek_v4.py), so they never exercise the real path and need no changes. The real discovery only runs at device-serving startup.

Coordination / follow-up

@gemini-code-assist

Copy link
Copy Markdown

Caution

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

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c431c121-061b-4f66-abd6-1722e6ae3898

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

DeepSeek V4 kernel directory discovery and module detection now use models/deepseek/v4-flash instead of models/deepseek/v4.

Changes

DeepSeek V4 Flash Kernel Path

Layer / File(s) Summary
Kernel path discovery and detection
pypto_serving/model/deepseek/npu_executor.py
Updates directory lookup and module-path checks to recognize DeepSeek V4 kernels under models/deepseek/v4-flash.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Poem

A bunny hops where kernels gleam,
Through v4-flash flows the stream.
Paths align and modules load,
Along the freshly marked code road.
=^.^=/**

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the kernel directory rename from v4 to v4-flash in DeepSeek serving.
Description check ✅ Passed The description directly explains the DeepSeek kernel path rename and the matching code updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pypto_serving/model/deepseek/npu_executor.py`:
- Around line 131-139: Update the kernel-directory lookup around the candidate
path in the executor initialization flow to remain compatible with checkouts
containing the existing models/deepseek/v4 location, or ensure this change is
gated and released atomically with the pypto-lib rename and pin update. Preserve
v4-flash resolution for updated checkouts while preventing premature
FileNotFoundError failures for older compatible layouts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7f7b01db-1146-477d-bd9e-9d00ffe5e7ee

📥 Commits

Reviewing files that changed from the base of the PR and between 8773989 and c10942d.

📒 Files selected for processing (1)
  • pypto_serving/model/deepseek/npu_executor.py

Comment thread pypto_serving/model/deepseek/npu_executor.py Outdated
pypto-lib renamed models/deepseek/v4 -> v4-flash (splitting the variant
into v4-flash + v4-pro). Point the DeepSeekV4 kernel discovery and the
module-file guard at models/deepseek/v4-flash.

Also accept the old models/deepseek/v4 path as a transition fallback. The
pypto-lib submodule pinned in this repo still carries v4 until it is
bumped, and serving's unit-tests job starts the accuracy test (real
discovery, not monkeypatched) against that submodule -- so hardcoding only
v4-flash breaks it. v4-flash is preferred when both exist. Function names
keep the "deepseek_v4" model-family identifier.

Follow-up (after the pypto-lib rename merges): bump the pypto-lib submodule
pin to a commit carrying models/deepseek/v4-flash, then drop the v4
fallback.
@lwDavid
lwDavid force-pushed the adapt/dsv4-kernel-path-v4-flash branch from c10942d to 6ffdb33 Compare July 23, 2026 01:30
The pinned pypto-lib (306519dc) was stale. Bump to lib main 72ee6a1, which
includes the v4 -> v4-flash + v4-pro split (#816), so serving's DeepSeek
accuracy guard runs against current kernels (kernel discovery now resolves
models/deepseek/v4-flash).
@lwDavid
lwDavid marked this pull request as draft July 23, 2026 06:16
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