Skip to content

fix: remove undefined LadeSpecDecLLM import from edge_model -- issue#568#569

Open
Priyanshu6968 wants to merge 1 commit into
kubeedge:mainfrom
Priyanshu6968:fixes/bug-issue#568
Open

fix: remove undefined LadeSpecDecLLM import from edge_model -- issue#568#569
Priyanshu6968 wants to merge 1 commit into
kubeedge:mainfrom
Priyanshu6968:fixes/bug-issue#568

Conversation

@Priyanshu6968

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

edge_model.py in the cloud-edge-collaborative-inference-for-llm example imported LadeSpecDecLLM from the models package, but that class is not defined or exported anywhere.

This was a half merged "lookahead decoding" backend: the import and the load() call site were added, but the implementation module and its export were never committed. This PR removes the dead wiring.

Drop LadeSpecDecLLM from the from models import ... statement.
Remove the unreachable elif self.backend == "LadeSpecDec" branch in load().
Remove the stale "LadeSepcDec" backend comment in test_queryrouting.yaml.

Which issue(s) this PR fixes:

Fixes #568

@kubeedge-bot kubeedge-bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. labels Jun 28, 2026
@kubeedge-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Priyanshu6968
To complete the pull request process, please assign jaypume after the PR has been reviewed.
You can assign the PR to them by writing /assign @jaypume in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 28, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request removes the unused LadeSpecDec backend from the cloud-edge collaborative inference example and cleans up the llm_simple_qa example by replacing hardcoded absolute paths with relative paths and Hugging Face model IDs. It also adds a basic length check in the accuracy metric calculation. The review feedback points out that the EagleSpecDec backend is currently unreachable due to validation checks in edge_model.py and suggests making the accuracy metric check more robust to prevent potential TypeError exceptions when y_true is invalid.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 74 to 75
elif self.backend == "EagleSpecDec":
self.model = EagleSpecDecModel(**self.kwargs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The "EagleSpecDec" backend is handled here in load(), but the validation check in __init__ (line 47) only permits ["huggingface", "vllm", "api"]. This makes the "EagleSpecDec" branch unreachable and will cause a ValueError during initialization if a user attempts to use it. Please update the allowed backends list in __init__ to include "EagleSpecDec".

Comment thread examples/llm_simple_qa/testenv/acc.py Outdated
Comment on lines +32 to +33
if not y_pred or len(y_pred) != len(y_true):
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If y_true is None or not a collection, calling len(y_true) will raise a TypeError. To make this function more robust and prevent potential runtime crashes, we should also check if y_true is valid before comparing their lengths.

Suggested change
if not y_pred or len(y_pred) != len(y_true):
return 0
if not y_true or not y_pred or len(y_pred) != len(y_true):
return 0

@kubeedge-bot kubeedge-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 28, 2026
Signed-off-by: Priyanshu6968 <priyanshunigam469@gmail.com>
@kubeedge-bot kubeedge-bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jun 28, 2026
@Priyanshu6968

Copy link
Copy Markdown
Author

/assign @jaypume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EdgeModel fails to import — LadeSpecDecLLM is undefined in cloud-edge-collaborative-inference-for-llm

3 participants