-
Notifications
You must be signed in to change notification settings - Fork 689
introduce cuda stream into runtime backend #14903
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
Conversation
This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14903
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 17 PendingAs of commit 2edb21a with merge base 0142a1a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
||
/** | ||
* Check a condition and log an error message if the condition is false. | ||
* | ||
* @param[in] _condition The condition to check. | ||
* @param[in] _format Log message format string. | ||
*/ | ||
#define ET_CHECK_OR_LOG(_condition, _format, ...) \ | ||
do { \ | ||
if (!(_condition)) { \ | ||
ET_LOG(Error, _format, ##__VA_ARGS__); \ | ||
} \ | ||
} while (0) | ||
|
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.
Make it explicit that we are logging at Error
level. Maybe ET_CHECK_OR_LOG_ERROR
? The other thing you can do is let this macro take a logging level.
This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/) [ghstack-poisoned]
Pull Request resolved: #14903 This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. ghstack-source-id: 314914426 @exported-using-ghexport Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/)
This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/) [ghstack-poisoned]
Pull Request resolved: #14903 This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. ghstack-source-id: 314915602 @exported-using-ghexport Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/)
This diff introduces CUDA streams into the Executorch runtime backend. The changes include: * Adding CUDA stream support to the `cuda_backend.cpp` file * Including the `cuda_runtime.h` header file in `cuda_backend.cpp` * Adding a `void* cuda_stream` field to the `AOTInductorModelContainer` struct in `aoti_model_container.h` to store the CUDA stream * Defining a new macro `ET_CHECK_OR_LOG` in `log.h` to check a condition and log an error message if the condition is false. Differential Revision: [D84128173](https://our.internmc.facebook.com/intern/diff/D84128173/) [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
This diff introduces CUDA streams into the Executorch runtime backend. The changes include:
cuda_backend.cpp
filecuda_runtime.h
header file incuda_backend.cpp
void* cuda_stream
field to theAOTInductorModelContainer
struct inaoti_model_container.h
to store the CUDA streamET_CHECK_OR_LOG
inlog.h
to check a condition and log an error message if the condition is false.Differential Revision: D84128173