-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Expose knobs to create and share (CPU) allocators across sessions in C# and Python #5634
Conversation
@@ -479,6 +479,11 @@ struct IoBinding : public Base<OrtIoBinding> { | |||
void ClearBoundOutputs(); | |||
}; | |||
|
|||
struct ArenaCfg : Base<OrtArenaCfg> { | |||
explicit ArenaCfg(std::nullptr_t) {} | |||
ArenaCfg(size_t max_mem, int arena_extend_strategy, int initial_chunk_size_bytes, int max_dead_bytes_per_chunk); |
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.
ArenaCfg [](start = 2, length = 8)
perhaps a factory method would be a good idea?
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.
But why though ? Why move from an established pattern ? Can you please elaborate on why it will be a good idea for this ?
ORT_API2_STATUS(CreateArenaCfg, _In_ size_t max_mem, int arena_extend_strategy, int initial_chunk_size_bytes, | ||
int max_dead_bytes_per_chunk, _Outptr_ OrtArenaCfg** out); | ||
|
||
ORT_CLASS_RELEASE(ArenaCfg); |
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.
ORT_CLASS_RELEASE(ArenaCfg); [](start = 2, length = 28)
Normally, this would be declared automatically
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.
How so ?
Description:
The C# and Python API follow-up for the feature added in #4813
The motivation is to allow C# and Python users to create multiple sessions that are backed by the same arena based allocator should they choose to
Motivation and Context
C# <-> C/C++ <-> Python API parity