Skip to content

chore: remove unused set_current_device_sm_limit setters - #249

Open
veyron-kairo wants to merge 1 commit into
Project-HAMi:mainfrom
veyron-kairo:chore/remove-dead-sm-scale-setters
Open

chore: remove unused set_current_device_sm_limit setters#249
veyron-kairo wants to merge 1 commit into
Project-HAMi:mainfrom
veyron-kairo:chore/remove-dead-sm-scale-setters

Conversation

@veyron-kairo

@veyron-kairo veyron-kairo commented Aug 4, 2026

Copy link
Copy Markdown

What this does

Removes two unused functions flagged in #231:

  • set_current_device_sm_limit(int dev, int scale) — declared in the header but never defined or called.
  • set_current_device_sm_limit_scale(int dev, int scale) — defined but never called anywhere in the tree, including test/.

A repo-wide search confirms neither symbol is referenced outside its own declaration/definition.

The sm_init_flag field that the scale setter used to touch is intentionally left in the shared-region struct — it is part of the memory-mapped, cross-process layout, so removing it would be a compatibility change beyond the scope of this cleanup. With the setter gone it is only initialized to 0 and never read, which is inert.

Credit to @KaminariOS for spotting these in #231.

Verification

Repo-wide grep confirms no remaining references. I was not able to run a full build locally (it needs the CUDA toolkit), but since the removed symbols have no callers or other definitions, the removal cannot affect compilation — the build-in-docker target / CI will confirm.

Fixes #231

Summary by CodeRabbit

  • Refactor
    • Removed legacy controls for adjusting device SM memory limits.
    • No end-user visible behavior changes are expected.

set_current_device_sm_limit is declared in the header but never defined or
called, and set_current_device_sm_limit_scale is defined but never called
anywhere in the tree (including test/). Remove both, as suggested in Project-HAMi#231.

The sm_init_flag field that the scale setter touched is left in the
shared-region struct to keep its cross-process memory layout stable; with the
setter gone it is simply initialized to 0 and never read.

Fixes Project-HAMi#231

Signed-off-by: Shridhar Panigrahi <198173519+veyron-kairo@users.noreply.github.com>
@hami-robot

hami-robot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: veyron-kairo
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes Code Review Process.

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

@hami-robot

hami-robot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Welcome @veyron-kairo! It looks like this is your first PR to Project-HAMi/HAMi-core 🎉

@hami-robot hami-robot Bot added the size/S label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 779c39d2-c176-44b8-a272-c16d5bb7df1e

📥 Commits

Reviewing files that changed from the base of the PR and between 5496322 and b8394e3.

📒 Files selected for processing (2)
  • src/multiprocess/multiprocess_memory_limit.c
  • src/multiprocess/multiprocess_memory_limit.h
💤 Files with no reviewable changes (2)
  • src/multiprocess/multiprocess_memory_limit.c
  • src/multiprocess/multiprocess_memory_limit.h

📝 Walkthrough

Walkthrough

The change removes the SM-limit scaling function from the implementation and removes the public declarations for both SM-limit setter APIs.

Changes

SM-limit API removal

Layer / File(s) Summary
Remove SM-limit setter APIs
src/multiprocess/multiprocess_memory_limit.c, src/multiprocess/multiprocess_memory_limit.h
The implementation and public declarations for the SM-limit setters were removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit found scale in the SM-limit gate,
“This unused little lever can wait.”
The function hopped out,
The declarations followed,
And the header grew lighter in weight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the removal of the two unused SM-limit setter functions.
Linked Issues check ✅ Passed The changes satisfy issue #231 by removing the unused SM-limit setter declarations and implementation.
Out of Scope Changes check ✅ Passed The changes are limited to removing unused SM-limit setter functions and their public declarations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

chore: remove the sm scale

1 participant