|
|
@@ -127,6 +127,19 @@ fn mp() {
|
|
|
cmd.contains("-e OMP_NUM_THREADS=4"),
|
|
|
"default OMP_NUM_THREADS missing"
|
|
|
);
|
|
|
+ assert!(
|
|
|
+ cmd.contains("-e NCCL_IGNORE_CPU_AFFINITY=1"),
|
|
|
+ "default NCCL_IGNORE_CPU_AFFINITY missing"
|
|
|
+ );
|
|
|
+ assert!(cmd.contains("-e NCCL_NET=IB"), "default NCCL_NET missing");
|
|
|
+ assert!(
|
|
|
+ cmd.contains("-e NCCL_CROSS_NIC=1"),
|
|
|
+ "default NCCL_CROSS_NIC missing"
|
|
|
+ );
|
|
|
+ assert!(
|
|
|
+ cmd.contains("-e NCCL_DEBUG=WARN"),
|
|
|
+ "default NCCL_DEBUG missing"
|
|
|
+ );
|
|
|
// Head node: no --headless
|
|
|
assert!(!cmd.contains("--headless"));
|
|
|
}
|
|
|
@@ -282,6 +295,10 @@ fn recipe_env_overrides_cluster_defaults() {
|
|
|
let mut r = trec();
|
|
|
r.env.insert("NCCL_CUMEM_ENABLE".into(), "1".into());
|
|
|
r.env.insert("OMP_NUM_THREADS".into(), "16".into());
|
|
|
+ r.env.insert("NCCL_IGNORE_CPU_AFFINITY".into(), "0".into());
|
|
|
+ r.env.insert("NCCL_NET".into(), "SOCKET".into());
|
|
|
+ r.env.insert("NCCL_CROSS_NIC".into(), "0".into());
|
|
|
+ r.env.insert("NCCL_DEBUG".into(), "INFO".into());
|
|
|
let cmd = run(&r, &tcls().nodes[0], true);
|
|
|
// Docker uses the last -e for duplicate keys, so recipe values come after.
|
|
|
// rfind returns the last occurrence, which should be the recipe override.
|
|
|
@@ -296,6 +313,27 @@ fn recipe_env_overrides_cluster_defaults() {
|
|
|
cmd[omp_pos..].starts_with("OMP_NUM_THREADS=16"),
|
|
|
"recipe override should be last"
|
|
|
);
|
|
|
+ // New NCCL defaults can also be overridden.
|
|
|
+ let ignore_pos = cmd.rfind("NCCL_IGNORE_CPU_AFFINITY=").unwrap();
|
|
|
+ assert!(
|
|
|
+ cmd[ignore_pos..].starts_with("NCCL_IGNORE_CPU_AFFINITY=0"),
|
|
|
+ "NCCL_IGNORE_CPU_AFFINITY should be overridable"
|
|
|
+ );
|
|
|
+ let net_pos = cmd.rfind("NCCL_NET=").unwrap();
|
|
|
+ assert!(
|
|
|
+ cmd[net_pos..].starts_with("NCCL_NET=SOCKET"),
|
|
|
+ "NCCL_NET should be overridable"
|
|
|
+ );
|
|
|
+ let cross_pos = cmd.rfind("NCCL_CROSS_NIC=").unwrap();
|
|
|
+ assert!(
|
|
|
+ cmd[cross_pos..].starts_with("NCCL_CROSS_NIC=0"),
|
|
|
+ "NCCL_CROSS_NIC should be overridable"
|
|
|
+ );
|
|
|
+ let debug_pos = cmd.rfind("NCCL_DEBUG=").unwrap();
|
|
|
+ assert!(
|
|
|
+ cmd[debug_pos..].starts_with("NCCL_DEBUG=INFO"),
|
|
|
+ "NCCL_DEBUG should be overridable"
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[test]
|