-
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
[AIR] Success criteria for numpy narrow waist #28346
Comments
Nice overall lgtm! Just adding a couple more things we discussed in our meeting:
Also might be out of scope, but in general we should make sure that preprocessors are using Datasets correctly (and taking advantage of stage fusion when applicable). Also is there anything for ragged tensors? |
Sg, this is basically what we discussed last time :) I'm assuming ragged tensors will be supported for this given the PR is about to be merged sooner than the rest, also it's captured as part of TensorArray iiuc. I think putting Preprocessor class as first-class UX is important but a bit orthogonal to this. We should track it tho. @amogkam we didn't have enough time to finish discussion on the predictor |
@jiaodong All of the data items should be the current state (each of which has been validated) so I don't know if including those items as part of the success criteria makes sense, but I might be missing something. I think all of the success criteria should be at the AIR level, around the preprocessors, training, and prediction? |
What are the risks with falling back to Python object for Predictors? Off the top of my head I can think of:
The benefit is that we can support the "long tail" of models with unique output types. |
+1 to having the fallback, i.e. a @amogkam how common is risk (1)? I feel like that wouldn't be very common. As for (2), we could add |
Actually would
Then the outputs can still go through the |
@clarkzinzow so I think there's perf and API aspect of it, for API most items should be AIR only, for example we had working PR for numpy narrow waist in batch predictor before 2.0 with I'm putting a data section for perf to ensure the numpy pass didn't trigger more unintended perf costs via concat / copy. Do you have other items on your mind for 2.1 regarding numpy narrow waist ? |
@amogkam I think you mentioned chaining predictors / using predictor as processor in meeting earlier this week, wouldn't fallback to python object break what you planned or it's not an issue ? Otherwise i vote for adding python object fallback too, it makes supporting arbitrary predictor output easier. |
@jiaodong it will break, but if we have np.ndarray with object dtype as the fallback instead of List[Any] I think that should be fine. |
@jiaodong The NumPy narrow waist will result in strictly less data copies than the Pandas or Arrow narrow waist (that's why it was initially added), so I don't think that we need that as a call-out, but we can have a single validation item for that if you'd like. Since there are no known Datasets code changes needed, how about we axe the Data items and have an AIR-level validation item for ensuring that our NumPy narrow waist isn't resulting in unnecessary copies anywhere? There's also a P1 for adding a new |
Sounds good ! I trust your judgment on this given all the context you have on data side. So how about we put data items as placeholder for now, we cross off items in this list that's already status-quo; Amog and I start adding the numpy path in AIR / predictor and if we discovered any corner cases (which i assume we will certainly run into) we can sync with data team to see what's the best action needed. |
@amogkam Hmm interesting... I feel like that
Would it be possible for Serve to not impose this restriction? It doesn't really make sense for model outputs which may be an arbitrary format, and I think we'll also want to support |
cc @simon-mo on the serve comment |
Isn't this also the case with
Can't we also document My reasoning is that
|
@amogkam I was thinking that we could make There's also the issue that an Your two points still stand, although I think we'll want to tweak (1) anyway since I think it's too strict for advanced As for (2), won't users need to munge their model outputs to have them fit their downstream preprocessors anyway? E.g. if a user is going to take the object detections from SSD300_VGG16 and apply some preprocessor, they're going to need to turn those model outputs into a format that the preprocessor understands, which the |
Synced with Clark and Amog offline, looks like for all options we had adding opaque object lead to more implications of AIR narrow waist or ability to chain predictor / preprocessor to others. Given the only case we know of is object detection, which ragged tensor support already greatly improved UX by eliminating the need of padding, we decided to punt it for now unless new clear use cases show up that requires a generic "simple" block format -- which requires a proper dedicated design. |
@jiaodong can this be closed out? |
E2E Successful User Journey
For sample computer vision workload that we had examples / benchmarks, training and batch prediction that is currently Pandas based:
Milestones and current progress
Relevant docs:
https://docs.google.com/document/d/1Er4df6OK78Mt_wiM80WNZr1SKXUEs_D-WNpKyiFwmd8/edit
Data:
map
andmap_batches
"zero_copy"
batch format #32662Processor:
BatchMapper
#28522BatchMapper
#28524Training:
Prediction:
predict_numpy
to DLPredictor types (tf, torch) #28525BatchPredictor
works with batch_format="numpy" as input & output #28627@clarkzinzow @amogkam I put down a tentative list of success criteria, please take another look and edit if you need !
The text was updated successfully, but these errors were encountered: