Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniupop committed Sep 13, 2024
1 parent 9b108ab commit 9cb4ef4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion fhevm-engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion fhevm-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ bincode = "1.3.3"
sha3 = "0.10.8"
anyhow = "1.0.86"
daggy = "0.8.0"
futures = "0.3.30"

[profile.dev.package.tfhe]
overflow-checks = false
1 change: 0 additions & 1 deletion fhevm-engine/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ bincode.workspace = true
sha3.workspace = true
anyhow.workspace = true
daggy.workspace = true
futures.workspace = true
fhevm-engine-common = { path = "../fhevm-engine-common" }

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion fhevm-engine/executor/src/dfg/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a, 'b> Scheduler<'a, 'b> {
let output = result.map_err(|_| SyncComputeError::ComputationFailed)??;
let index = output.0;
let node_index = NodeIndex::new(index);
// Satisfy deps from the eecuted task
// Satisfy deps from the executed task
for edge in self.edges.edges_directed(node_index, Direction::Outgoing) {
let child_index = edge.target();
let child_node = self.graph.node_weight_mut(child_index).unwrap();
Expand Down
26 changes: 1 addition & 25 deletions fhevm-engine/executor/src/dfg/types.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
use daggy::NodeIndex;
use futures::{future::BoxFuture, FutureExt};
use std::{future::Future, task::Poll};

use fhevm_engine_common::types::{Handle, SupportedFheCiphertexts};

use crate::server::{InMemoryCiphertext, SyncComputeError};
use crate::server::InMemoryCiphertext;

pub type DFGTaskResult = Option<InMemoryCiphertext>;

#[allow(variant_size_differences)]
#[derive(Clone)]
pub enum DFGTaskInput {
Val(SupportedFheCiphertexts),
Handle(Handle),
}

pub struct SchedTask<'a> {
pub idx: NodeIndex,
pub fut: BoxFuture<'a, Result<InMemoryCiphertext, SyncComputeError>>,
}

impl<'a> Future for SchedTask<'a> {
type Output = (NodeIndex, Result<InMemoryCiphertext, SyncComputeError>);

fn poll(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> Poll<Self::Output> {
match self.fut.poll_unpin(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(output) => Poll::Ready((self.idx, output)),
}
}
}
3 changes: 2 additions & 1 deletion fhevm-engine/executor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use tokio::task::spawn_blocking;
use tonic::{transport::Server, Code, Request, Response, Status};

use crate::dfg::{scheduler::Scheduler, DFGraph};

pub mod common {
tonic::include_proto!("fhevm.common");
}
Expand Down Expand Up @@ -104,7 +105,7 @@ impl FhevmExecutor for FhevmExecutorService {
// Run the request's computations in an async block
let handle = tokio::runtime::Handle::current();
let _ = handle.enter();
let resp = futures::executor::block_on(async {
let resp = handle.block_on(async {
// Build the dataflow graph for this request
let mut graph = DFGraph::default();
if let Err(e) = graph.build_from_request(req, &state) {
Expand Down

0 comments on commit 9cb4ef4

Please sign in to comment.