"docs/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "8a347b62cf5c907d2676bdc983354834e500a282"
Commit 389f67cc authored by Ramesh Errabolu's avatar Ramesh Errabolu
Browse files

Fix RBT to allow Fine grain regions to be reported by GPU devices

parent 945a8bef
...@@ -99,8 +99,11 @@ function( parse_version VERSION_STRING ) ...@@ -99,8 +99,11 @@ function( parse_version VERSION_STRING )
endif () endif ()
# Add Build Info from Jenkins # Add Build Info from Jenkins
set ( ROCM_BUILD_ID "DevBld" CACHE STRING "Jenkins Build Id" ) set ( ROCM_BUILD_ID "DevBld" CACHE STRING "Local Build Id" FORCE )
if(DEFINED ENV{ROCM_BUILD_ID})
set ( ROCM_BUILD_ID $ENV{ROCM_BUILD_ID} CACHE STRING "Jenkins Build Id" FORCE )
endif()
# Update Version Patch to include Number of Commits and hash of HEAD # Update Version Patch to include Number of Commits and hash of HEAD
set ( VERSION_PATCH "${PATCH}.${COMMIT_CNT}-${ROCM_BUILD_ID}-${COMMIT_HASH}" PARENT_SCOPE ) set ( VERSION_PATCH "${PATCH}.${COMMIT_CNT}-${ROCM_BUILD_ID}-${COMMIT_HASH}" PARENT_SCOPE )
......
...@@ -789,13 +789,14 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() { ...@@ -789,13 +789,14 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
// Initialize version of the test // Initialize version of the test
version_.major_id = 2; version_.major_id = 2;
version_.minor_id = 3; version_.minor_id = 3;
version_.step_id = 3; version_.step_id = 4;
version_.reserved = 0; version_.reserved = 0;
bw_iter_cnt_ = getenv("ROCM_BW_ITER_CNT"); bw_iter_cnt_ = getenv("ROCM_BW_ITER_CNT");
bw_default_run_ = getenv("ROCM_BW_DEFAULT_RUN"); bw_default_run_ = getenv("ROCM_BW_DEFAULT_RUN");
bw_blocking_run_ = getenv("ROCR_BW_RUN_BLOCKING"); bw_blocking_run_ = getenv("ROCR_BW_RUN_BLOCKING");
skip_fine_grain_ = getenv("ROCM_SKIP_FINE_GRAINED_POOL"); skip_cpu_fine_grain_ = getenv("ROCM_SKIP_CPU_FINE_GRAINED_POOL");
skip_gpu_coarse_grain_ = getenv("ROCM_SKIP_GPU_COARSE_GRAINED_POOL");
if (bw_iter_cnt_ != NULL) { if (bw_iter_cnt_ != NULL) {
int32_t num = atoi(bw_iter_cnt_); int32_t num = atoi(bw_iter_cnt_);
......
...@@ -488,7 +488,8 @@ class RocmBandwidthTest : public BaseTest { ...@@ -488,7 +488,8 @@ class RocmBandwidthTest : public BaseTest {
// Env key to determine if Fine-grained or // Env key to determine if Fine-grained or
// Coarse-grained pool should be filtered out // Coarse-grained pool should be filtered out
char* skip_fine_grain_; char* skip_cpu_fine_grain_;
char* skip_gpu_coarse_grain_;
// Env key to determine if the run should block // Env key to determine if the run should block
// or actively wait on completion signal // or actively wait on completion signal
......
...@@ -106,10 +106,11 @@ hsa_status_t MemPoolInfo(hsa_amd_memory_pool_t pool, void* data) { ...@@ -106,10 +106,11 @@ hsa_status_t MemPoolInfo(hsa_amd_memory_pool_t pool, void* data) {
} }
// Consult user request and add either fine-grained or // Consult user request and add either fine-grained or
// coarse-grained memory pools if agent is CPU // coarse-grained memory pools if agent is CPU. Default
// is to skip coarse-grained memory pools
agent_info_t& agent_info = asyncDrvr->agent_list_.back(); agent_info_t& agent_info = asyncDrvr->agent_list_.back();
if (agent_info.device_type_ == HSA_DEVICE_TYPE_CPU) { if (agent_info.device_type_ == HSA_DEVICE_TYPE_CPU) {
if (asyncDrvr->skip_fine_grain_ != NULL) { if (asyncDrvr->skip_cpu_fine_grain_ != NULL) {
if (is_fine_grained == true) { if (is_fine_grained == true) {
return HSA_STATUS_SUCCESS; return HSA_STATUS_SUCCESS;
} }
...@@ -119,9 +120,21 @@ hsa_status_t MemPoolInfo(hsa_amd_memory_pool_t pool, void* data) { ...@@ -119,9 +120,21 @@ hsa_status_t MemPoolInfo(hsa_amd_memory_pool_t pool, void* data) {
} }
} }
} }
// hsa_device_type_t device_type;
// status = hsa_agent_get_info(agent, HSA_AGENT_INFO_DEVICE, &device_type); // Consult user request and add either fine-grained or
// ErrorCheck(status); // coarse-grained memory pools if agent is GPU. Default
// is to skip fine-grained memory pools
if (agent_info.device_type_ == HSA_DEVICE_TYPE_GPU) {
if (asyncDrvr->skip_gpu_coarse_grain_ != NULL) {
if (is_fine_grained == false) {
return HSA_STATUS_SUCCESS;
}
} else {
if (is_fine_grained == true) {
return HSA_STATUS_SUCCESS;
}
}
}
// Create an instance of agent_pool_info and add it to the list // Create an instance of agent_pool_info and add it to the list
pool_info_t pool_info(agent, asyncDrvr->agent_index_, pool, pool_info_t pool_info(agent, asyncDrvr->agent_index_, pool,
...@@ -231,7 +244,7 @@ void RocmBandwidthTest::PopulateAccessMatrix() { ...@@ -231,7 +244,7 @@ void RocmBandwidthTest::PopulateAccessMatrix() {
uint32_t path; uint32_t path;
path = (access == HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED) ? 0 : 1; path = (access == HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED) ? 0 : 1;
direct_access_matrix_[(src_dev_idx * agent_index_) + dst_dev_idx] = path; direct_access_matrix_[(src_dev_idx * agent_index_) + dst_dev_idx] = path;
if ((src_dev_type == HSA_DEVICE_TYPE_CPU) && if ((src_dev_type == HSA_DEVICE_TYPE_CPU) &&
(dst_dev_type == HSA_DEVICE_TYPE_GPU) && (dst_dev_type == HSA_DEVICE_TYPE_GPU) &&
(access == HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED)) { (access == HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED)) {
......
...@@ -130,7 +130,7 @@ bool RocmBandwidthTest::FilterCpuPool(uint32_t req_type, ...@@ -130,7 +130,7 @@ bool RocmBandwidthTest::FilterCpuPool(uint32_t req_type,
// If env to skip fine grain is NULL it means // If env to skip fine grain is NULL it means
// we should filter out coarse-grain pools // we should filter out coarse-grain pools
if (skip_fine_grain_ == NULL) { if (skip_cpu_fine_grain_ == NULL) {
return (fine_grained == false); return (fine_grained == false);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment