Skip to content

Commit

Permalink
[hotfix] Fix if-else condition for FSU
Browse files Browse the repository at this point in the history
Currently, only the forwarding code is distinguished when Train and Swap are enabled.
I also added a case where Swap is turned off and only Inference is turned on.

**Self evaluation:**
1. Build test:	 [X]Passed [ ]Failed [ ]Skipped
2. Run test:	 [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Donghak PARK <[email protected]>
  • Loading branch information
DonghakPark authored and myungjoo committed Dec 24, 2024
1 parent 3ac9404 commit ea8307c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nntrainer/models/neuralnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ sharedConstTensors NeuralNetwork::forwarding(
PROFILE_MEM_ANNOTATE("Forwarding for layer: " + node->getName());

auto f = std::get<0>(node->getExecutionOrder());

bool swap_mode = std::get<props::MemorySwap>(model_flex_props);
// temperally remain. when we evaluate all for asynch mode, we weill remove
if (exec_mode == ExecutionMode::TRAIN) {
if (exec_mode == ExecutionMode::TRAIN or
(exec_mode == ExecutionMode::INFERENCE and !swap_mode)) {
model_graph.flushCacheExcept(f);
node->forwarding(training);
} else {

/**
currently, it supports FSU asynch mode for inference. The prcedure of
FSU is below,
Expand Down

0 comments on commit ea8307c

Please sign in to comment.