-
Notifications
You must be signed in to change notification settings - Fork 0
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
DFG task granularity #57
Conversation
92f603d
to
410565d
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.
Some comments
MaxLocality, | ||
} | ||
|
||
impl std::fmt::Debug for ExecNode { |
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.
Instead of this you can just add #[derive(Debug)]
on ExecNode
and you'd also add these annotations to dependent structures like NodeIndex
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.
I think the debug formatting would not be very helpful if I did that - not sure if maybe I misunderstand your comment.
.build() | ||
.unwrap(); | ||
rayon_pool.broadcast(|_| { | ||
set_server_key(keys.server_key.clone()); |
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.
Maybe rayon pool could be initialized before tokio runtime to do rayon pool key initialization once? Usually runtimes have lightweight handles to them so they could be cloned if needed
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.
The rayon thread pool doesn't seem to support cloning. This is a localised rayon thread pool to avoid interference from operations in other tokio blocking threads. This is very lightweight too since it's in an Arc.
rayon_pool.broadcast(|_| { | ||
set_server_key(keys.server_key.clone()); | ||
}); | ||
THREAD_POOL.set(Some(rayon_pool)); |
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.
We could probably use here cloned version of the runtime
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.
Same as above - we can't clone. If we don't use tokio threads, the global rayon thread pool is used otherwise.
… execution capability The task scheduling is controlled by the FHEVM_DF_SCHEDULE environment variable with available policies: - MAX_PARALLELISM: preserves parallelism but aggregates dependent tasks to take advantage of spatial and temporal cache locality. - MAX_LOCALITY: aggregates all connected components in the DFG to improve cache locality. - FINE_GRAIN: disable task aggregation and executes each FHE operation based on DFG dependences.
46703d9
to
50f949e
Compare
This will restrict the rayon thread pool exposed to TFHE-rs in order to improve the scheduling of concurrent FHE operations. Each re-usable thread pool is used exclusively for one scheduler task, which improves cache locality and reduces interference from other operations.
50f949e
to
695f79a
Compare
No description provided.