Add rccl API support (#66)

* [Draft]: Add rccl API support

* Partial tests

Need to add tests to the cmake file
This commit is contained in:
Mythreya
2024-09-11 15:57:51 -07:00
committed by GitHub
parent 11a4668306
commit b71f9cabe6
8 changed files with 267 additions and 0 deletions
+14
View File
@@ -1,6 +1,7 @@
#include <amdhip/amdhip.hpp>
#include <hsa-runtime/hsa-runtime.hpp>
#include <rccl/rccl.hpp>
#include <roctx/roctx.hpp>
#include <dlfcn.h>
@@ -29,6 +30,13 @@ hsa_init()
printf("[%s] %s\n", ROCP_REG_FILE_NAME, __FUNCTION__);
}
ncclResult_t
ncclGetVersion(int*)
{
printf("[%s] %s\n", ROCP_REG_FILE_NAME, __FUNCTION__);
return {};
}
void
roctx_range_push(const char* name)
{
@@ -78,6 +86,7 @@ rocprofiler_set_api_table(const char* name,
using hip_table_t = hip::HipApiTable;
using hsa_table_t = hsa::HsaApiTable;
using roctx_table_t = roctx::ROCTxApiTable;
using rccl_table_t = rccl::rcclApiFuncTable;
auto* _wrap_v = std::getenv("ROCP_REG_TEST_WRAP");
bool _wrap = (_wrap_v != nullptr && std::stoi(_wrap_v) != 0);
@@ -107,6 +116,11 @@ rocprofiler_set_api_table(const char* name,
_table->roctxRangePush_fn = &rocprofiler::roctx_range_push;
_table->roctxRangePop_fn = &rocprofiler::roctx_range_pop;
}
else if(std::string_view{ name } == "rccl")
{
rccl_table_t* _table = static_cast<rccl_table_t*>(tables[0]);
_table->ncclGetVersion_fn = &rocprofiler::ncclGetVersion;
}
}
return 0;