Skip to content

chore: remove sm scale from sm limit setter - #232

Open
KaminariOS wants to merge 2 commits into
Project-HAMi:mainfrom
KaminariOS:chore/remove-sm-scale
Open

chore: remove sm scale from sm limit setter#232
KaminariOS wants to merge 2 commits into
Project-HAMi:mainfrom
KaminariOS:chore/remove-sm-scale

Conversation

@KaminariOS

@KaminariOS KaminariOS commented Jul 24, 2026

Copy link
Copy Markdown

Closes #231

This PR removes the ambiguous sm-scale API path and keeps SM limit setting as an explicit limit value.

Summary by CodeRabbit

  • New Features

    • Added support for setting a device’s SM memory limit using a specific absolute value.
  • Bug Fixes

    • Improved memory-limit configuration consistency by switching from scale-based adjustments to direct limit assignment.
  • Breaking Changes

    • Updated the public SM-limit setter to accept limit (absolute) instead of a scale value.

@hami-robot

hami-robot Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: KaminariOS
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 Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

@hami-robot hami-robot Bot added the size/XS label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@KaminariOS, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ea7a1072-29ab-425b-9c04-98635f9e38ed

📥 Commits

Reviewing files that changed from the base of the PR and between c37b40b and 3994d31.

📒 Files selected for processing (1)
  • src/multiprocess/multiprocess_memory_limit.c
📝 Walkthrough

Walkthrough

The SM memory-limit API now accepts an explicit limit and assigns it directly, replacing the previous scale-based behavior. Initialization guards and device validation remain unchanged.

Changes

SM limit API

Layer / File(s) Summary
Absolute SM limit setter
src/multiprocess/multiprocess_memory_limit.h, src/multiprocess/multiprocess_memory_limit.c
The public setter now accepts limit, assigns it directly to sm_limit[dev], and removes the scale-based helper declaration while preserving existing guards and validation.

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

Suggested labels: enhancement

Suggested reviewers: chaunceyjiang, archlitchi

Poem

A rabbit hops past limits bright,
No scaling tricks are needed tonight.
Set the SM value, crisp and clear,
The guarded path remains sincere.
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes removing the SM scale parameter from the SM limit setter.
Linked Issues check ✅ Passed The PR removes the unclear scale parameter from the SM limit setter as requested in issue #231.
Out of Scope Changes check ✅ Passed The changes are focused on the SM limit setter API and implementation with no evident unrelated edits.
✨ 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.

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 24, 2026
Signed-off-by: kosumi <chankocyo@gmail.com>

@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 `@src/multiprocess/multiprocess_memory_limit.c`:
- Around line 1241-1245: Update the device validation in the surrounding
function so an invalid dev value logs the error and returns before reaching the
sm_limit[dev] assignment. Preserve the existing behavior for valid device IDs,
and fix the noted whitespace in the touched lines.
🪄 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 Plus

Run ID: 050c1fa6-25b0-4935-9e5f-24bb4851c04a

📥 Commits

Reviewing files that changed from the base of the PR and between 52f33fc and fb317b2.

📒 Files selected for processing (2)
  • src/multiprocess/multiprocess_memory_limit.c
  • src/multiprocess/multiprocess_memory_limit.h

Comment thread src/multiprocess/multiprocess_memory_limit.c
Signed-off-by: kosumi <chankocyo@gmail.com>
@mesutoezdil

mesutoezdil commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@mesutoezdil

Copy link
Copy Markdown
Contributor

nit --> get_current_device_sm_limit has the same issue (missing return on illegal dev). out of scope here, could be a separate issue..

@KaminariOS

KaminariOS commented Jul 27, 2026

Copy link
Copy Markdown
Author

nit --> get_current_device_sm_limit has the same issue (missing return on illegal dev). out of scope here, could be a separate issue..

Actually, there are 6 of them.

But that should indeed be a separate issue.

The one I changed is a setter not used anywhere so it should be fine.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: remove the sm scale

2 participants