[GH-ISSUE #239] [Feature Request] Maybe we can add env var to control whether use min sms? #137

Closed
opened 2026-10-26 21:13:33 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @MARD1NO on GitHub (Dec 12, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/239

I found in kernel get_best_config function, there exist some logic to compute the kernel minimum use sm:

// Recompute the minimal number of SMs required
    // NOTES: less L2 cache usage and less GPU frequency drop
    int num_min_sms = num_sms;
    if (ArchSpec::should_minimize_num_sms()) {
        num_min_sms = ceil_div(ceil_div(m, best_block_m) * ceil_div(n, best_block_n) * num_groups, best_num_waves);
        num_min_sms = align(num_min_sms, best_multicast_config.num_multicast);
        DG_HOST_ASSERT(num_min_sms <= num_sms);
    }

It invoke kernel compilation many times, which cause unstable ttft time, maybe we should add envvar to control

Originally created by @MARD1NO on GitHub (Dec 12, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/239 I found in kernel `get_best_config` function, there exist some logic to compute the kernel minimum use sm: ``` // Recompute the minimal number of SMs required // NOTES: less L2 cache usage and less GPU frequency drop int num_min_sms = num_sms; if (ArchSpec::should_minimize_num_sms()) { num_min_sms = ceil_div(ceil_div(m, best_block_m) * ceil_div(n, best_block_n) * num_groups, best_num_waves); num_min_sms = align(num_min_sms, best_multicast_config.num_multicast); DG_HOST_ASSERT(num_min_sms <= num_sms); } ``` It invoke kernel compilation many times, which cause unstable ttft time, maybe we should add envvar to control
Author
Owner

@MARD1NO commented on GitHub (Jan 19, 2026):

The latest version fix this issue

<!-- gh-comment-id:3766264229 --> @MARD1NO commented on GitHub (Jan 19, 2026): The latest version fix this issue
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepGEMM#137
No description provided.