mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #413] [CLOSED] Fix integer environment parsing #426
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#426
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/413
Author: @OllieinCanada
Created: 8/24/2026
Status: ❌ Closed
Base:
main← Head:fix/strict-env-int-parsing📝 Commits (2)
a81ac04Fix integer environment parsingea051a0Test and reject duplicate integer signs📊 Changes
3 files changed (+102 additions, -3 deletions)
View changed files
➕
csrc/utils/env.hpp(+42 -0)📝
csrc/utils/system.hpp(+5 -3)➕
tests/test_env.cpp(+55 -0)📄 Description
Fixes #412
Summary
Make integer environment-variable parsing deterministic and reject malformed or
out-of-range values.
Root cause
get_env<int>()ignored the return value fromstd::sscanf()and returned anuninitialized local variable when an environment value did not begin with a
valid integer. Partial values such as
16abcwere also silently accepted.Fix
std::from_chars()and require full consumptionleading
+identifies the environment variable
This does not change unset-variable defaults or string environment variables.
Validation
The host-only regression test passed with GCC 9.4 in C++17 mode using:
The test covers zero, signed values, surrounding whitespace,
INT_MIN,INT_MAX, empty input, whitespace-only input, malformed booleans, partialnumbers, hex-like input, and positive/negative overflow. It requires no CUDA,
GPU, model, network access, or submodules.
The CUDA/GPU test suite was not run in this environment.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
cin SM90fp8_einsum("bhr,hdr->bhd")to prevent silent data corruption insm90_fp8_bmm#480