-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SWAP] Implement inference mode #2696
base: main
Are you sure you want to change the base?
Conversation
lhs8928
commented
Aug 5, 2024
- This pr is simply rebase [Wait for #2286] [SWAP] Implement inference mode #2300 to current main. Please refer to [Wait for #2286] [SWAP] Implement inference mode #2300 for more details.
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2696. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lhs8928, 💯 All CI checkers are successfully verified. Thanks.
9163d60
to
1e1e782
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lhs8928, 💯 All CI checkers are successfully verified. Thanks.
@DonghakPark Can you please check the clang-format version issue? |
Signed-off-by: Jiho Chu <[email protected]>
Signed-off-by: Jiho Chu <[email protected]>
This patch is for inference mode for swap device. It re-enable mmap feature, but writing time is controlled manually, due to the inference mode handling. Signed-off-by: Jiho Chu <[email protected]>
1e1e782
to
42c1e8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lhs8928, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/** | ||
* @brief Constructor | ||
* | ||
* @param value value to set, defaults to current directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param value value to set, defaults to current directory | |
* @param value value to set, defaults to "train" mode |
TensorLifespan var_ls = TensorLifespan::MAX_LIFESPAN; | ||
TensorLifespan var_ls = swap_mode == "inference" | ||
? TensorLifespan::FORWARD_INFER_LIFESPAN | ||
: TensorLifespan::MAX_LIFESPAN; | ||
TensorLifespan grad_ls = TensorLifespan::BACKWARD_FUNC_LIFESPAN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pure question (it may be irrelevant to this PR, though).
Do we need grad_ls
for the inference swap mode? Is it related to the loss thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a minor suggestion on the comment.
@@ -88,7 +89,7 @@ void *SwapDevice::getBuffer(off_t offset, size_t size, bool alloc_only) { | |||
<< "SwapDevice: seek file: " << dev_path; | |||
|
|||
len = read(fd, ptr, size); | |||
NNTR_THROW_IF(len != (ssize_t)size, std::runtime_error) | |||
NNTR_THROW_IF(len != (size_t)size, std::runtime_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to cast 'ssize_t' to 'size_t'?
because it looks 'read func' returns 'ssize_t' type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!