Skip to content

Commit b9d6ff3

Browse files
committed
add back logicalTopology param
1 parent a3d6ffd commit b9d6ff3

3 files changed

Lines changed: 32 additions & 13 deletions

File tree

src/sst/elements/astra/astraWorkload.cc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,26 @@ AstraWorkload::AstraWorkload(ComponentId_t id, Params& params) : Component(id) {
4040
injectionScale_ = params.find<double>("injectionScale", 1.0);
4141
rendezvousProtocol_ = params.find<bool>("rendezvousProtocol", false);
4242

43-
// TODO: What am I actually supposed to put in logicalDims?
43+
// Users may optionally specify a logical mesh topology. Otherwise a ring will be assumed.
44+
if (params.contains("logicalTopology")) {
45+
if (params.is_value_array("logicalTopology")) {
46+
params.find_array<int>("logicalTopology", logicalDims_);
47+
} else {
48+
out_->fatal(CALL_INFO, 1, "logicalTopology was given but is not a valid array\n");
49+
}
50+
} else {
51+
logicalDims_.push_back(numNPUs_);
52+
}
53+
54+
int prod = 1;
55+
for (int d : logicalDims_) {
56+
prod *= d;
57+
}
58+
if (prod != numNPUs_) {
59+
out_->fatal(CALL_INFO, 1, "The product of the logicalTopology mesh dimensions must match numNPUs. Product=%d, numNPUs=%d\n", prod, numNPUs_);
60+
}
61+
62+
params.find_array<int>("logicalTopologyConfig", logicalDims_);
4463
logicalDims_.push_back(numNPUs_);
4564
queuesPerDim_ = std::vector<int>(logicalDims_.size(), numQueuesPerDim_);
4665

src/sst/elements/astra/astraWorkload.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ class AstraWorkload : public SST::Component
5050
)
5151

5252
SST_ELI_DOCUMENT_PARAMS(
53-
{"numNPUs", "Number of NPUs to model", NULL },
54-
{"workloadConfig", "Workload config file", NULL },
55-
{"systemConfig", "System config file", NULL },
56-
{"memoryConfig", "Remote memory config file", NULL },
57-
{"commGroupConfig", "Communicator group config file", "empty" },
58-
{"logicalTopologyConfig", "Logical topology config string", NULL },
59-
{"loggingConfig", "Logging config file", "empty" },
60-
{"numQueuesPerDim", "Number of queues per dimension", "1" },
61-
{"commScale", "Communication scale", "1.0" },
62-
{"injectionScale", "Injection scale", "1.0" },
63-
{"rendezvousProtocol", "Whether to enable rendezvous protocol", "false" },
53+
{"numNPUs", "Number of NPUs to model", NULL },
54+
{"workloadConfig", "Workload config file", NULL },
55+
{"systemConfig", "System config file", NULL },
56+
{"memoryConfig", "Remote memory config file", NULL },
57+
{"commGroupConfig", "Communicator group config file", "empty" },
58+
{"logicalTopology", "Logical topology mesh dimensions (array)", "[numNPUs]"},
59+
{"loggingConfig", "Logging config file", "empty" },
60+
{"numQueuesPerDim", "Number of queues per dimension", "1" },
61+
{"commScale", "Communication scale", "1.0" },
62+
{"injectionScale", "Injection scale", "1.0" },
63+
{"rendezvousProtocol", "Whether to enable rendezvous protocol", "false" },
6464
)
6565

6666
SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS( { "nic", "Network interface(s). One per endpoint.", "SST::Astra::AstraNIC"} )
@@ -85,7 +85,6 @@ class AstraWorkload : public SST::Component
8585
std::string systemConfig_;
8686
std::string memoryConfig_;
8787
std::string commGroupConfig_;
88-
std::string logicalTopologyConfig_;
8988
std::string loggingConfig_;
9089
int numQueuesPerDim_;
9190
double commScale_;

src/sst/elements/astra/tests/astra-test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def build(self, nID, extraKeys):
8282
"systemConfig": system_file,
8383
"memoryConfig": memory_file,
8484
"commGroupConfig": comm_group_file,
85+
#"logicalTopology": [2, 2],
8586
})
8687

8788
ep = AstraJob(0, numNPUs, workload)

0 commit comments

Comments
 (0)