Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/AMSlib/ams_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,21 @@ ADD_AMS_UNIT_TEST(AMS_GRAPH_FALLBACK ams_graph_fallback)
BUILD_UNIT_TEST(ams_graph_surrogate test_graph_surrogate.cpp)
ADD_AMS_UNIT_TEST(AMS_GRAPH_SURROGATE ams_graph_surrogate)

BUILD_UNIT_TEST(ams_graph_mgn_surrogate test_graph_mgn_surrogate.cpp)
target_link_libraries(ams_graph_mgn_surrogate PRIVATE nlohmann_json::nlohmann_json)
target_compile_definitions(ams_graph_mgn_surrogate
PRIVATE
AMS_MGN_DIFFUSION_FIXTURE_DIR="${AMS_TEST_ROOT}/models/mgn_graph_diffusion"
)

# Final runtime check for the MGN diffusion workflow: fixtures mode must have
# produced the TorchScript model and binary graph cases before AMS parity runs.
add_test(
NAME MGN_DIFFUSION_AMS_PARITY
COMMAND $<TARGET_FILE:ams_graph_mgn_surrogate> -s --reporter console
)
set_tests_properties(MGN_DIFFUSION_AMS_PARITY PROPERTIES
DEPENDS MGN_DIFFUSION_FIXTURES
LABELS "AMS_INTERFACE;MGN_DIFFUSION"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
21 changes: 2 additions & 19 deletions tests/AMSlib/ams_interface/test_graph_fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,9 @@ CATCH_TEST_CASE("AMSHomogeneousGraph validates construction",
AMSInit();

CATCH_REQUIRE_NOTHROW(makeValidGraph());
{
AMSHomogeneousGraph graph(makeNodeFeatures(),
makeEdgeIndex32(),
makeEdgeFeatures());
CATCH_REQUIRE(graph.global_features.shape().size() == 1);
CATCH_REQUIRE(graph.global_features.shape()[0] == 0);
}
CATCH_REQUIRE_NOTHROW(AMSHomogeneousGraph(makeNodeFeatures(),
makeEdgeIndex64(),
makeEdgeFeatures(),
makeTensor<float>({0})));
CATCH_REQUIRE_NOTHROW(AMSHomogeneousGraph(makeNodeFeatures(),
makeEdgeIndex64(),
makeEdgeFeatures(),
makeGlobalFeatures()));
makeEdgeIndex32(),
makeEdgeFeatures()));

CATCH_REQUIRE_THROWS_AS(AMSHomogeneousGraph(makeTensor<int64_t>({3, 2}),
makeEdgeIndex64(),
Expand Down Expand Up @@ -172,11 +160,6 @@ CATCH_TEST_CASE("AMSHomogeneousGraph validates construction",
makeEdgeIndex64(),
makeTensor<int64_t>({2, 1})),
std::runtime_error);
CATCH_REQUIRE_THROWS_AS(AMSHomogeneousGraph(makeNodeFeatures(),
makeEdgeIndex64(),
makeEdgeFeatures(),
makeTensor<float>({1, 2})),
std::runtime_error);
CATCH_REQUIRE_THROWS_AS(AMSHomogeneousGraph(makeNodeFeatures(),
makeEdgeIndex64(),
makeEdgeFeatures(),
Expand Down
Loading
Loading