Skip to content
Open
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
9 changes: 8 additions & 1 deletion bin/run-model/src/run-model/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ int main(int argc, char **argv) {
/*workSpaceSize=*/1024 * 1024,
/*allowTensorOpMathConversion=*/true);

bool has_gpus = []() {
FlexFlow::Realm::Machine::ProcessorQuery pq(
FlexFlow::Realm::Machine::get_machine());
pq.only_kind(FlexFlow::Realm::Processor::Kind::TOC_PROC);
return pq.count() > 0;
}();

PCGInstance pcg_instance = create_pcg_instance(
/*ctx=*/ctx,
/*mpcg=*/mpcg,
Expand All @@ -103,7 +110,7 @@ int main(int argc, char **argv) {
/*input_tensors=*/input_tensors,
/*profiling_settings=*/ProfilingSettings{0_n, 1_p},
/*device_handle=*/device_handle,
/*device_type=*/DeviceType::GPU);
/*device_type=*/has_gpus ? DeviceType::GPU : DeviceType::CPU);

// begin training loop
int num_epochs = 5;
Expand Down
Loading