Skip to content

Commit a084189

Browse files
PyTorch interface (#235)
* DLPack support * Support computation over external buffers * Add `placeholder` operator * Updated plan format * Operator bug fixes * Other interface changes --------- Co-authored-by: noli <t-ngerawork@microsoft.com> Co-authored-by: Noli Gerawork <ngerawor@andrew.cmu.edu>
1 parent d8bbaeb commit a084189

118 files changed

Lines changed: 4318 additions & 4699 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@
1717
[submodule "third_party/json"]
1818
path = third_party/json
1919
url = https://github.com/nlohmann/json
20+
21+
[submodule "third_party/dlpack"]
22+
path = third_party/dlpack
23+
url = https://github.com/dmlc/dlpack

.vscode/c_cpp_properties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"name": "Linux",
55
"includePath": [
66
"${workspaceFolder}/**",
7+
"${workspaceFolder}/third_party/mscclpp/include",
78
"/usr/local/cuda/include",
89
"/opt/rocm/include"
910
],

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang
9191
target_link_options(coverage_config INTERFACE --coverage)
9292
endif()
9393

94-
# Find ibverbs
95-
include(FindIBVerbs)
96-
9794
# Find NUMA
9895
include(FindNUMA)
9996

ark/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ if(ARK_USE_ROCM)
1111
set_source_files_properties(${CU_SOURCES} PROPERTIES LANGUAGE CXX)
1212
endif()
1313

14-
set(COMMON_LIBS ARK::numa ARK::ibverbs pthread rt)
14+
set(COMMON_LIBS ARK::numa pthread rt)
1515

1616
# ARK object
1717
target_include_directories(ark_obj PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
1818
target_include_directories(ark_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
1919
target_include_directories(ark_obj SYSTEM PRIVATE
20+
${DLPACK_INCLUDE_DIRS}
2021
${JSON_INCLUDE_DIRS}
2122
${MSCCLPP_INCLUDE_DIRS}
22-
${IBVERBS_INCLUDE_DIRS}
2323
${NUMA_INCLUDE_DIRS}
2424
)
2525

@@ -54,7 +54,6 @@ if(ARK_BUILD_TESTS)
5454
target_include_directories(${exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
5555
target_include_directories(${exe_name} SYSTEM PRIVATE
5656
${JSON_INCLUDE_DIRS}
57-
${IBVERBS_INCLUDE_DIRS}
5857
${NUMA_INCLUDE_DIRS}
5958
)
6059

ark/api/context.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ void Context::set(const std::string& key, const std::string& value,
2929
this->impl_->set(key, value_json, type);
3030
}
3131

32+
std::string Context::dump() const {
33+
return this->impl_->dump().dump();
34+
}
35+
3236
} // namespace ark

ark/api/context_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ ark::unittest::State test_context() {
5252

5353
UNITTEST_EQ(nodes[0]->context.size(), 0);
5454
UNITTEST_EQ(nodes[1]->context.size(), 1);
55-
UNITTEST_EQ(nodes[1]->context.at("key0"), ark::Json("val1"));
55+
UNITTEST_EQ(nodes[1]->context.at("key0"), ark::Json({"val1"}));
5656
UNITTEST_EQ(nodes[2]->context.size(), 2);
57-
UNITTEST_EQ(nodes[2]->context.at("key0"), ark::Json("val1"));
58-
UNITTEST_EQ(nodes[2]->context.at("key1"), ark::Json("val2"));
57+
UNITTEST_EQ(nodes[2]->context.at("key0"), ark::Json({"val1"}));
58+
UNITTEST_EQ(nodes[2]->context.at("key1"), ark::Json({"val2"}));
5959
UNITTEST_EQ(nodes[3]->context.size(), 1);
60-
UNITTEST_EQ(nodes[3]->context.at("key0"), ark::Json("val3"));
60+
UNITTEST_EQ(nodes[3]->context.at("key0"), ark::Json({"val3"}));
6161

6262
return ark::unittest::SUCCESS;
6363
}

0 commit comments

Comments
 (0)