-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[Refactor] Remove dead code in tests and parallel_state #41471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
e4476d8
f574351
57c70d1
de522f4
8cd2d09
c366cd3
a2619c1
7411328
8a1c0df
2f2e637
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,15 +120,12 @@ def update_finished_set( | |
| # Use the first worker's kv_connector_stats as accumulator. | ||
| aggregated_kv_connector_stats = kv_output.kv_connector_stats | ||
| elif kv_connector_stats := kv_output.kv_connector_stats: | ||
| if aggregated_kv_connector_stats is None: | ||
| aggregated_kv_connector_stats = kv_connector_stats | ||
| else: | ||
| assert isinstance( | ||
| aggregated_kv_connector_stats, type(kv_connector_stats) | ||
| ) | ||
| aggregated_kv_connector_stats = ( | ||
| aggregated_kv_connector_stats.aggregate(kv_connector_stats) | ||
| ) | ||
| assert isinstance( | ||
| aggregated_kv_connector_stats, type(kv_connector_stats) | ||
| ) | ||
| aggregated_kv_connector_stats = aggregated_kv_connector_stats.aggregate( | ||
| kv_connector_stats | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is ok |
||
|
|
||
| # Aggregate kv_connector_worker_meta from all workers. | ||
| if aggregated_kv_connector_worker_meta is None: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1251,9 +1251,6 @@ def get_dcp_group() -> GroupCoordinator: | |
| return _DCP | ||
|
|
||
|
|
||
| # kept for backward compatibility | ||
| get_context_model_parallel_group = get_dcp_group | ||
|
|
||
| _PP: GroupCoordinator | None = None | ||
|
|
||
|
|
||
|
|
@@ -1821,31 +1818,6 @@ def model_parallel_is_initialized(): | |
| _TP_STATE_PATCHED = False | ||
|
|
||
|
|
||
| @contextmanager | ||
| def patch_tensor_parallel_group(tp_group: GroupCoordinator): | ||
| """Patch the tp group temporarily until this function ends. | ||
|
|
||
| This method is for draft workers of speculative decoding to run draft model | ||
| with different tp degree from that of target model workers. | ||
|
|
||
| Args: | ||
| tp_group (GroupCoordinator): the tp group coordinator | ||
| """ | ||
| global _TP_STATE_PATCHED | ||
| assert not _TP_STATE_PATCHED, "Should not call when it's already patched" | ||
|
|
||
| _TP_STATE_PATCHED = True | ||
| old_tp_group = get_tp_group() | ||
| global _TP | ||
| _TP = tp_group | ||
| try: | ||
| yield | ||
| finally: | ||
| # restore the original state | ||
| _TP_STATE_PATCHED = False | ||
| _TP = old_tp_group | ||
|
|
||
|
|
||
| def get_tensor_model_parallel_world_size() -> int: | ||
| """Return world size for the tensor model parallel group.""" | ||
| return get_tp_group().world_size | ||
|
|
@@ -1856,16 +1828,6 @@ def get_tensor_model_parallel_rank() -> int: | |
| return get_tp_group().rank_in_group | ||
|
|
||
|
|
||
| def get_decode_context_model_parallel_world_size() -> int: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @youkaichao can we remove these?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DarkLight1337 seems that @youkaichao is quite busy recently, check again this is not used at all, could we land this PR in this case?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
| """Return world size for the decode context model parallel group.""" | ||
| return get_dcp_group().world_size | ||
|
|
||
|
|
||
| def get_decode_context_model_parallel_rank() -> int: | ||
| """Return my rank for the decode context model parallel group.""" | ||
| return get_dcp_group().rank_in_group | ||
|
|
||
|
|
||
| def get_node_count() -> int: | ||
| """Return the total number of nodes in the distributed environment.""" | ||
| assert _NODE_COUNT is not None, "distributed environment is not initialized" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.