已合并
set default streampool to 32 #23271
SCh-zx创建于 2025年7月22日
set default streampool to 32 #23271
已合并
从refs/pull/23271/head合入到v2.7.1
共 2 个文件变更+8-8
| @@ -38,14 +38,14 @@ class HcclStreamIdTest(TestCase): | |||
| 38 | dist_group.recv(recv_tensor, src) | 38 | dist_group.recv(recv_tensor, src) |
| 39 | p2p_stream_id = _world.default_pg._get_backend(torch.device('npu'))._get_stream_id(True, src) | 39 | p2p_stream_id = _world.default_pg._get_backend(torch.device('npu'))._get_stream_id(True, src) |
| 40 | 40 | ||
| 41 | - stream_num = os.environ.get("STREAMS_PER_DEVICE", 8) | 41 | + stream_num = os.environ.get("STREAMS_PER_DEVICE", 32) |
| 42 | try: | 42 | try: |
| 43 | stream_num = int(stream_num) | 43 | stream_num = int(stream_num) |
| 44 | except Exception: | 44 | except Exception: |
| 45 | - stream_num = 8 | 45 | + stream_num = 32 |
| 46 | 46 | ||
| 47 | - if stream_num != 32: | 47 | + if stream_num != 8: |
| 48 | - stream_num = 8 | 48 | + stream_num = 32 |
| 49 | assert0 = ((collective_stream_id & stream_num) == stream_num) | 49 | assert0 = ((collective_stream_id & stream_num) == stream_num) |
| 50 | assert1 = (collective_stream_id == p2p_stream_id) | 50 | assert1 = (collective_stream_id == p2p_stream_id) |
| 51 | collective_stream = torch.npu.Stream(stream_id=collective_stream_id, device_type=20) | 51 | collective_stream = torch.npu.Stream(stream_id=collective_stream_id, device_type=20) |
| @@ -497,11 +497,11 @@ uint32_t OptionsManager::GetStreamsPerDevice() | |||
| 497 | { | 497 | { |
| 498 | const static uint32_t streams_per_device = []() -> uint32_t { | 498 | const static uint32_t streams_per_device = []() -> uint32_t { |
| 499 | char* buf_val = std::getenv("STREAMS_PER_DEVICE"); | 499 | char* buf_val = std::getenv("STREAMS_PER_DEVICE"); |
| 500 | - // Default 8 | 500 | + // Default 32 |
| 501 | - int64_t streams_per_device = (buf_val != nullptr) ? strtol(buf_val, nullptr, 10) : 8; | 501 | + int64_t streams_per_device = (buf_val != nullptr) ? strtol(buf_val, nullptr, 10) : 32; |
| 502 | if (streams_per_device != 8 && streams_per_device != 32) { | 502 | if (streams_per_device != 8 && streams_per_device != 32) { |
| 503 | - streams_per_device = 8; | 503 | + streams_per_device = 32; |
| 504 | - TORCH_NPU_WARN_ONCE("STREAMS_PER_DEVICE only support 8 or 32, but get other value, so reset it to the default value 8"); | 504 | + TORCH_NPU_WARN_ONCE("STREAMS_PER_DEVICE only support 8 or 32, but get other value, so reset it to the default value 32"); |
| 505 | } | 505 | } |
| 506 | return static_cast<uint32_t>(streams_per_device); | 506 | return static_cast<uint32_t>(streams_per_device); |
| 507 | }(); | 507 | }(); |