Skip to content

Commit 11f727d

Browse files
author
pytorchbot
committed
2026-05-13 nightly release (03794f5)
1 parent 32c110a commit 11f727d

3 files changed

Lines changed: 49 additions & 8 deletions

File tree

fbgemm_gpu/src/config/feature_gates.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ std::string to_string(const FeatureGateName& value) {
3535
namespace {
3636

3737
// Returns true iff the env var "FBGEMM_<key>" is set (regardless of value).
38-
bool env_has_key(const std::string& key) {
38+
[[maybe_unused]] bool env_has_key(const std::string& key) {
3939
const auto env_var = "FBGEMM_" + key;
4040
return std::getenv(env_var.c_str()) != nullptr;
4141
}
4242

4343
// Reads the env var "FBGEMM_<key>" and returns true iff it is set to "1".
44-
bool ev_check_key(const std::string& key) {
44+
bool env_check_key(const std::string& key) {
4545
const auto env_var = "FBGEMM_" + key;
4646

4747
const auto value = std::getenv(env_var.c_str());
@@ -122,14 +122,14 @@ class FeatureGate {
122122
#ifdef FBGEMM_FBCODE
123123
static const NoJkMode mode = NoJkMode::from_env();
124124
if (mode == NoJkMode::EnvOnly) {
125-
value = ev_check_key(key);
125+
value = env_check_key(key);
126126
} else if (mode == NoJkMode::EnvFirstThenJk) {
127-
value = env_has_key(key) ? ev_check_key(key) : jk_check_key(key);
127+
value = env_has_key(key) ? env_check_key(key) : jk_check_key(key);
128128
} else /* NoJkMode::JkOnly */ {
129129
value = jk_check_key(key);
130130
}
131131
#else
132-
value = ev_check_key(key);
132+
value = env_check_key(key);
133133
#endif
134134

135135
cache_.insert({key, value});

fbgemm_gpu/test/config/feature_gate_no_jk_cpp_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace config = fbgemm_gpu::config;
2020
//
2121
// In FBCODE builds, these exercise the new EnvFirstThenJk path: env_has_key
2222
// returning true must short-circuit the JustKnobs lookup, so the value comes
23-
// from ev_check_key alone.
23+
// from env_check_key alone.
2424
//
2525
// In OSS builds, the same env values flow through the unconditional env-only
2626
// path (FBGEMM_NO_JK is ignored), and the assertions still hold by

fbgemm_gpu/test/tbe/training/backward_sgd_test.py

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def execute_backward_sgd_( # noqa C901
9797
return
9898
if use_cpu and weights_precision == SparseType.FP16:
9999
return
100-
# No bag ops only work on GPUs, no mixed, no weighted
101-
if use_cpu and pooling_mode == PoolingMode.NONE:
100+
# V1 API doesn't support nobag on CPU (only PT2 path does)
101+
if use_cpu and pooling_mode == PoolingMode.NONE and use_api_v1:
102102
return
103103
if mixed and pooling_mode == PoolingMode.NONE:
104104
return
@@ -449,6 +449,47 @@ def test_backward_sgd( # noqa C901
449449
SparseType.FP32, # output_dtype
450450
)
451451

452+
@given(
453+
T=st.integers(min_value=1, max_value=3),
454+
D=st.sampled_from([2, 4, 128, 256]),
455+
B=st.integers(min_value=1, max_value=10),
456+
log_E=st.integers(min_value=3, max_value=5),
457+
L=st.integers(min_value=1, max_value=20),
458+
long_segments=st.booleans(),
459+
)
460+
@settings(
461+
verbosity=VERBOSITY,
462+
max_examples=MAX_EXAMPLES,
463+
deadline=None,
464+
suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.data_too_large],
465+
)
466+
def test_backward_sgd_fp32_pmNONE_cpu(
467+
self,
468+
T: int,
469+
D: int,
470+
B: int,
471+
log_E: int,
472+
L: int,
473+
long_segments: bool,
474+
) -> None:
475+
self.execute_backward_sgd_(
476+
T,
477+
D,
478+
B,
479+
log_E,
480+
L,
481+
weights_precision=SparseType.FP32,
482+
weighted=False,
483+
mixed=False,
484+
mixed_B=False,
485+
use_cache=False,
486+
cache_algorithm=CacheAlgorithm.LRU,
487+
long_segments=long_segments,
488+
pooling_mode=PoolingMode.NONE,
489+
use_cpu=True,
490+
output_dtype=SparseType.FP32,
491+
)
492+
452493
@given(
453494
T=st.integers(min_value=1, max_value=5),
454495
D=st.integers(min_value=2, max_value=256),

0 commit comments

Comments
 (0)