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

NumpyReader to use HostWorkspace #3011

Merged
merged 3 commits into from
Jun 7, 2021

Conversation

jantonguirao
Copy link
Contributor

@jantonguirao jantonguirao commented Jun 2, 2021

Signed-off-by: Joaquin Anton janton@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • Refactoring to improve flexibility of implementation and to adhere to the current HostWorkspace.

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    Reworked NumpyReader to use HostWorkspace instead of SampleWorkspace, so that we can control the level of parallelism (e.g. intra-sample parallelism)
  • Affected modules and functionalities:
    NumpyReader
  • Key points relevant for the review:
    NA
  • Validation and testing:
    Existing tests apply
  • Documentation (including examples):
    NA

JIRA TASK: [DALI-2127]

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2432291]: BUILD STARTED

@jantonguirao jantonguirao marked this pull request as ready for review June 2, 2021 12:16
int ndim = file_0.image.shape().sample_dim();

TensorListShape<> sh(max_batch_size_, ndim);
for (int i = 0; i < max_batch_size_; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of max_batch_size_ it should check size of prefetched_batch_queue_[curr_batch_consumer_]. Just for the future.

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@@ -118,12 +118,12 @@ bool NumpyReader::SetupImpl(std::vector<OutputDesc> &output_desc,
// If necessary start prefetching thread and wait for a consumable batch
DataReader<CPUBackend, ImageFileWrapper>::SetupImpl(output_desc, ws);

int batch_size = prefetched_batch_queue_[curr_batch_consumer_].size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making that a function, like GetCurrentBatchSize() or something?

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2432291]: BUILD FAILED

@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2440607]: BUILD STARTED

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2441014]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2441014]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2441014]: BUILD PASSED

@jantonguirao jantonguirao merged commit 806c74f into NVIDIA:main Jun 7, 2021
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

Successfully merging this pull request may close these issues.

4 participants