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

Validate sparse features of input request #482

Closed
wants to merge 1 commit into from

Conversation

s4ayub
Copy link
Contributor

@s4ayub s4ayub commented Jun 28, 2022

Summary:
the validation i have right now checks whether the sum of the lengths tensor matches the size of the values tensor

this has to hold true (based on this example: https://www.internalfb.com/code/fbsource/[0d1af3ec6b12bbccd59a22f3e6f2e0f9bd01aa6b]/fbcode/torchrec/sparse/jagged_tensor.py?lines=643-659)

next:

  • add float feature validation

Why is validation in populateTrecRequestFromTensorMap in TrecGpuUtils.cpp?

  • because I didn't want to iterate through all the features twice. we already have to iterate through all the features once to convert the request to a torchrec request, to be efficient, the validation should happen during this conversion as well
  • if populateTrecRequestFromTensorMap throws an exception, it is handled by TrecGpuMon.cpp already
  • we can do something similar in hpc/predictor/server, which i left as a comment if this design is accepted, I'll make that change

Differential Revision: D37385890

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jun 28, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37385890

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37385890

s4ayub added a commit to s4ayub/torchrec-3 that referenced this pull request Jun 28, 2022
Summary:
Pull Request resolved: pytorch#482

Why is validation in `populateTrecRequestFromTensorMap` in `TrecGpuUtils.cpp`?
- because I didn't want to iterate through all the features twice. we already have to iterate through all the features once to convert the request to a torchrec request, to be efficient, the validation should happen during this conversion as well
- if `populateTrecRequestFromTensorMap` throws an exception, it is handled by `TrecGpuMon.cpp` already

Differential Revision: D37385890

fbshipit-source-id: c3eb616d985bbee55a42e9ce74b5f61e0eb7955a
@s4ayub s4ayub force-pushed the export-D37385890 branch from b9beb59 to 1c4c73f Compare June 28, 2022 16:22
s4ayub added a commit to s4ayub/torchrec-3 that referenced this pull request Jun 29, 2022
Summary:
Pull Request resolved: pytorch#482

Why is validation in `populateTrecRequestFromTensorMap` in `TrecGpuUtils.cpp`?
- because I didn't want to iterate through all the features twice. we already have to iterate through all the features once to convert the request to a torchrec request, to be efficient, the validation should happen during this conversion as well
- if `populateTrecRequestFromTensorMap` throws an exception, it is handled by `TrecGpuMon.cpp` already

Reviewed By: zyan0

Differential Revision: D37385890

fbshipit-source-id: 119fb13fbe8e37fb28c08c3e726ab914162b97be
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37385890

@s4ayub s4ayub force-pushed the export-D37385890 branch from 1c4c73f to f80c740 Compare June 29, 2022 19:28
Summary:
Pull Request resolved: pytorch#482

Why is validation in `populateTrecRequestFromTensorMap` in `TrecGpuUtils.cpp`?
- because I didn't want to iterate through all the features twice. we already have to iterate through all the features once to convert the request to a torchrec request, to be efficient, the validation should happen during this conversion as well
- if `populateTrecRequestFromTensorMap` throws an exception, it is handled by `TrecGpuMon.cpp` already

Reviewed By: zyan0

Differential Revision: D37385890

fbshipit-source-id: 7f6d2271ba261788cddd1a4d88b89dda757e6a5f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37385890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants