Skip to content
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

How does the function ModelInstanceState::ProcessRequests do inference for each request? #31

Open
songkq opened this issue May 15, 2023 · 0 comments

Comments

@songkq
Copy link

songkq commented May 15, 2023

@zzk0 @hjchen2 @mosout Hi, I'm confusing whether SetInputTensors and Execute functions serve for only one request or all the requests simultaneously. If they serve for all the requests, how is parallelism implemented?Could you please give some advice?

  // collect input
  std::vector<const char*> input_names;
  std::vector<oneflow_api::Tensor> input_tensors;
  std::vector<BackendMemory*> input_memories;
  bool cuda_copy = false;
  BackendInputCollector collector(
      requests, request_count, &responses, model_state_->TritonMemoryManager(),
      model_state_->EnablePinnedInput(), CudaStream());
  SetInputTensors(
      total_batch_size, requests, request_count, &responses, &collector,
      &input_names, &input_tensors, &input_memories, &cuda_copy);
  SynchronizeStream(CudaStream(), cuda_copy);

  // execute
  uint64_t compute_start_ns = 0;
  SET_TIMESTAMP(compute_start_ns);

  std::vector<oneflow_api::Tensor> output_tensors;
  Execute(&responses, request_count, &input_tensors, &output_tensors);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant