diff --git a/test/distributed/test_hccl_stream_id.py b/test/distributed/test_hccl_stream_id.py index 9be7044479d13415bd8b058ca5192ce8f68c06da..ae34f806563541dfa2caf13ce2f35cede09c503a 100644 --- a/test/distributed/test_hccl_stream_id.py +++ b/test/distributed/test_hccl_stream_id.py @@ -38,14 +38,14 @@ class HcclStreamIdTest(TestCase): dist_group.recv(recv_tensor, src) p2p_stream_id = _world.default_pg._get_backend(torch.device('npu'))._get_stream_id(True, src) - stream_num = os.environ.get("STREAMS_PER_DEVICE", 8) + stream_num = os.environ.get("STREAMS_PER_DEVICE", 32) try: stream_num = int(stream_num) except Exception: - stream_num = 8 + stream_num = 32 - if stream_num != 32: - stream_num = 8 + if stream_num != 8: + stream_num = 32 assert0 = ((collective_stream_id & stream_num) == stream_num) assert1 = (collective_stream_id == p2p_stream_id) collective_stream = torch.npu.Stream(stream_id=collective_stream_id, device_type=20) diff --git a/torch_npu/csrc/core/npu/register/OptionsManager.cpp b/torch_npu/csrc/core/npu/register/OptionsManager.cpp index 1eedf54559d1171ab270b1288523fdf0295ffa63..6a822abb33488bf2c1286888f38b7c2d6b9fd9c3 100644 --- a/torch_npu/csrc/core/npu/register/OptionsManager.cpp +++ b/torch_npu/csrc/core/npu/register/OptionsManager.cpp @@ -497,10 +497,10 @@ uint32_t OptionsManager::GetStreamsPerDevice() const static uint32_t streams_per_device = []() -> uint32_t { char* buf_val = std::getenv("STREAMS_PER_DEVICE"); // Default 8 - int64_t streams_per_device = (buf_val != nullptr) ? strtol(buf_val, nullptr, 10) : 8; + int64_t streams_per_device = (buf_val != nullptr) ? strtol(buf_val, nullptr, 10) : 32; if (streams_per_device != 8 && streams_per_device != 32) { - streams_per_device = 8; - TORCH_NPU_WARN_ONCE("STREAMS_PER_DEVICE only support 8 or 32, but get other value, so reset it to the default value 8"); + streams_per_device = 32; + TORCH_NPU_WARN_ONCE("STREAMS_PER_DEVICE only support 8 or 32, but get other value, so reset it to the default value 32"); } return static_cast(streams_per_device); }();