feat(vidur): sweep P/D network configurations - #297
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional pd_networks dimension to Vidur’s config-explorer so capacity search/Pareto analysis can sweep colocated vs P/D-separated deployments across multiple fabric bandwidth/dtype points while preserving legacy behavior when the dimension is absent.
Changes:
- Introduces
PDNetworkConfigand threads it throughJobConfiggeneration, validation, and CLI-arg materialization. - Extends job/cache key generation to incorporate the selected P/D network point (when non-default).
- Adds documented example sweep points in
debug_config.ymland a focused unit-test suite.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/debug_config.yml | Adds example pd_networks sweep points for mixed vs P/D-separated runs. |
| vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/config.py | Implements PDNetworkConfig, integrates it into JobConfig validation/keying/config materialization, and sweeps it in config generation. |
| vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/init.py | Exports PDNetworkConfig from the config package. |
| vidur-alibabacloud/tests/test_pd_network_config_sweep.py | Adds tests for design-space expansion, legacy behavior, and invalid-point rejection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
90e88d1 to
0285f5e
Compare
Signed-off-by: Yanshu WANG <wangyanshu2016@gmail.com>
Signed-off-by: Yanshu WANG <wangyanshu2016@gmail.com>
0285f5e to
02acd08
Compare
|
Contributor metadata follow-up: rewrote both commits without content changes so author, committer, and the sole |
|
recheck |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/config.py:240
generate_job_configs()usesconfig.get("pd_networks", ...), which will returnNone(or[]) if the YAML includespd_networks:but leaves it empty. That makesitertools.product(...)fail with aTypeError(or produce zero jobs) instead of falling back to the intended legacy mixed-mode default.
config["schedulers"],
config["tp_dimensions"],
config["pp_dimensions"],
config["batch_sizes"],
config.get("pd_networks", [{"name": "mixed"}]),
vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/config.py:272
generate_unique_model_job_configs()indexesconfig.get("pd_networks", ...)[0]. Ifpd_networksis present but empty/null in YAML, this will raiseIndexError(orTypeError) during cache warmup, even though the dimension is optional.
pd_network_config = PDNetworkConfig(
**config.get("pd_networks", [{"name": "mixed"}])[0]
)
vidur-alibabacloud/vidur/config_optimizer/config_explorer/config/config.py:126
PDNetworkConfig.is_valid()validates ratio and bandwidths, but does not validatepd_p2p_comm_dtype. The underlyingReplicaConfigCLI restricts this field viachoices(e.g.fp8,float16,float32), so an invalid dtype would only fail later during simulation/CLI parsing instead of being rejected up front as an invalid sweep point.
This issue also appears in the following locations of the same file:
- line 236
- line 270
def is_valid(self, num_replicas: int):
if not 0 < self.pd_node_ratio <= 1:
return False
if min(
self.pd_p2p_comm_bandwidth,
Summary
Add
pd_networksas an optional Vidur config-explorer dimension so the existing capacity search and Pareto analyzer can compare colocated and P/D-separated deployment points across fabric bandwidths.PDNetworkConfig;ReplicaConfigCLI fields;pd_networksis absent;debug_config.yml.Closes #296.
Validation
Three focused tests cover design-space expansion, legacy compatibility and invalid-point rejection.
Remote smoke on
lingjun-101, Python 3.11, fresh branch clone (1fca827):test_pd_network_dimension_expands_job_configs: PASStest_legacy_config_keeps_single_mixed_mode_job: PASStest_invalid_pd_split_or_bandwidth_is_rejected: PASSNo GPU or production service was used.