-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Data] Use function name for progress bars in ray dataset #31526
[Data] Use function name for progress bars in ray dataset #31526
Conversation
277878c
to
b728e5e
Compare
Hi @peytondmurray, thanks for opening up the PR! Could you rebase the PR to latest master, and fix the unit test failures? Thanks. |
Yep, working on the test failures now. Unfortunately it seems like stdout is being examined in many tests across the code base, so anything that calls |
b78bd4d
to
81a0850
Compare
Okay, I think test failures appear to be unrelated. |
@bveeramani Love the idea. There's a little trouble in that the function that gets passed to It might be possible to do this by examining Edit Okay, so one alternative I came up with is to attach the Edit 2 Never mind, you can get the class name from a bound method with |
74ac9d2
to
68bb2e1
Compare
@bveeramani @ericl Preprocessors now correctly show their class names; here's what the progress bars currently look like:
|
Oh title() is super weird, I don't know why anyone would want it force-lowercasing the other chars. How about we use this replacement function instead?
|
Sure, I'll try this and see what the impact on other tests is. |
29a0e8a
to
70d40f3
Compare
Signed-off-by: pdmurray <[email protected]>
70d40f3
to
2bcb03e
Compare
This PR is a quick fix to remove the non-useful comment introduced in #31526, probably during debugging. Replace the comment with a meaningful one.
…ect#32020) This PR is a quick fix to remove the non-useful comment introduced in ray-project#31526, probably during debugging. Replace the comment with a meaningful one.
…32411) This is to fix the Dataset.__repr__ issue in #32410, after we introduce function name in #31526. We should only make operator/stage name to be camel case. Signed-off-by: Cheng Su <[email protected]>
…ay-project#32411) This is to fix the Dataset.__repr__ issue in ray-project#32410, after we introduce function name in ray-project#31526. We should only make operator/stage name to be camel case. Signed-off-by: Cheng Su <[email protected]>
…32411) (#32434) This is to fix the Dataset.__repr__ issue in #32410, after we introduce function name in #31526. We should only make operator/stage name to be camel case. Signed-off-by: Cheng Su <[email protected]>
Signed-off-by: pdmurray <[email protected]> Signed-off-by: pdmurray <[email protected]> Signed-off-by: Edward Oakes <[email protected]>
…ect#32020) This PR is a quick fix to remove the non-useful comment introduced in ray-project#31526, probably during debugging. Replace the comment with a meaningful one. Signed-off-by: Edward Oakes <[email protected]>
…ay-project#32411) This is to fix the Dataset.__repr__ issue in ray-project#32410, after we introduce function name in ray-project#31526. We should only make operator/stage name to be camel case. Signed-off-by: Cheng Su <[email protected]> Signed-off-by: Edward Oakes <[email protected]>
Why are these changes needed?
This PR changes
map_batches
to display an informative name in the progress bar that is created during calls toray.data.dataset.Dataset.map_batches
instead of a generic "map_batches" message, so that a user knows what function is being computed for a given display bar. Iffn
is a bound method of aPreprocessor
subclass, the progress bar displays the name of the class. Otherwise theMapBatches(fn.__name__)
is displayed; if the__name__
attribute is not present on the callable passed tomap_batches
,type(fn)
is used instead; this happens if the callable is a class instance, for example.Related issue number
Closes #31224.
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.