Skip to content

Commit 3a8c686

Browse files
issue/811 add warmups before cuda graph capture
1 parent 91f91f7 commit 3a8c686

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/infinicore/graph/graph.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ void Graph::instantiate() {
8080
// Reset device graph
8181
device_graph_ = std::make_unique<DeviceGraph>();
8282

83+
// warmup
84+
for (size_t iter = 0; iter < 5; ++iter) {
85+
this->run();
86+
}
87+
infinicore::context::syncStream();
88+
8389
if (infinirtStreamBeginCapture(
8490
context::getStream(),
8591
INFINIRT_STREAM_CAPTURE_MODE_GLOBAL)

0 commit comments

Comments
 (0)