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

add ops for running a custom pytorch classifier #38

Merged
merged 10 commits into from
Jan 10, 2024

Conversation

edknv
Copy link
Contributor

@edknv edknv commented Dec 12, 2023

This PR moves most of the logic in Embedder to its new parent class Predictor. Predictor accepts any pytroch model and returns the outputs as a cudf dataframe. Embedder is a special case where we want the sentence_embedding field in the output dictionary, and hence inherits from Predictor.

The custom model in the sample script is copied almost verbatim from https://gitlab-master.nvidia.com/dl/JoC/nemo-data-curator/-/merge_requests/13 with a few minor modifications.

Copy link

Benchmark comparison for 2a7eefe (main) vs a1b8a319 (PR)


--------------------------------------------------------------------------------------------- benchmark: 2 tests ---------------------------------------------------------------------------------------------
Name (time in s)                                  Min                 Max                Mean            StdDev             Median               IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_fiqa_all_MiniLM_L6_v2 (0001_main)        97.6566 (1.0)      102.1067 (1.0)       99.6314 (1.0)      1.9383 (1.43)     99.9509 (1.00)     3.3780 (1.85)          2;0  0.0100 (1.0)           5           1
test_fiqa_all_MiniLM_L6_v2 (0002_a1b8a31)     98.8487 (1.01)     102.2326 (1.00)     100.0698 (1.00)     1.3551 (1.0)      99.6398 (1.0)      1.8300 (1.0)           1;0  0.0100 (1.00)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

Copy link

Benchmark comparison for 2a7eefe (main) vs deb571a3 (PR)


---------------------------------------------------------------------------------------------- benchmark: 2 tests ---------------------------------------------------------------------------------------------
Name (time in s)                                  Min                 Max                Mean            StdDev              Median               IQR            Outliers     OPS            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_fiqa_all_MiniLM_L6_v2 (0001_main)        97.1364 (1.0)       99.9895 (1.0)       98.4655 (1.0)      1.2675 (1.0)       97.8458 (1.0)      2.1610 (1.0)           2;0  0.0102 (1.0)           5           1
test_fiqa_all_MiniLM_L6_v2 (0002_deb571a)     99.0572 (1.02)     102.5828 (1.03)     100.8467 (1.02)     1.7278 (1.36)     101.0998 (1.03)     3.4006 (1.57)          3;0  0.0099 (0.98)          5           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@edknv edknv marked this pull request as ready for review December 19, 2023 13:37
@edknv edknv merged commit bbaadae into rapidsai:main Jan 10, 2024
9 of 10 checks passed
@edknv edknv deleted the nemo-data-curator-0 branch January 10, 2024 23:07
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.

2 participants