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

Expose all pipeline constructor arguments as properties. #2757

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Mar 4, 2021

Signed-off-by: Michał Zientkiewicz mzient@gmail.com

Why we need this PR?

Pick one, remove the rest

  • It adds missing properties to Pipeline, so they can be queries in graph definition function

What happened in this PR?

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

  • What solution was applied:
    • Added missing properties
    • Delay translation of some of the fields until they are passed to native pipeline
  • Affected modules and functionalities:
    • pipeline.py
  • Key points relevant for the review:
    • N/A
  • Validation and testing:
    • Added test that queries all properties
  • Documentation (including examples):
    • Docstrings

JIRA TASK: DALI-1897

@mzient mzient requested a review from a team March 4, 2021 12:26
@mzient
Copy link
Contributor Author

mzient commented Mar 4, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2132237]: BUILD STARTED

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@mzient
Copy link
Contributor Author

mzient commented Mar 4, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2132249]: BUILD STARTED

def test_properties():
@dali.pipeline_def(batch_size=11, prefetch_queue_depth={"cpu_size":3, "gpu_size":2})
def my_pipe():
pipe = Pipeline.current()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we advertise Pipeline.current() anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not documented very well - I don't know if it should in this PR or we should elaborate on it in some doc/tutorial.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe in getting started?
@awolant ?

@JanuszL JanuszL self-assigned this Mar 4, 2021
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2132249]: BUILD PASSED

dali/python/nvidia/dali/pipeline.py Show resolved Hide resolved
dali/python/nvidia/dali/pipeline.py Show resolved Hide resolved

@property
def seed(self):
"""Random seed used in the pipeline or None, if seed is not fixed."""
Copy link
Contributor

Choose a reason for hiding this comment

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

You are not checking if seed is not fixed(?)

Copy link
Contributor Author

@mzient mzient Mar 4, 2021

Choose a reason for hiding this comment

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

I removed replacement of None with -1 in the constructor. Now it's done when passing the seed to the native pipeline.

@jantonguirao jantonguirao self-assigned this Mar 4, 2021
@mzient mzient merged commit a80a1d4 into NVIDIA:master Mar 4, 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.

None yet

4 participants