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

Fix Spark-DL notebooks for CI/CD and update to latest dependencies #439

Merged
merged 37 commits into from
Oct 15, 2024

Conversation

rishic3
Copy link
Contributor

@rishic3 rishic3 commented Sep 30, 2024

Changes:

Version updates:

  • Updated all examples to run with latest Triton (24.08), Tensorflow (2.17.0), and Torch (2.4.1), and match updated APIs.
  • Notable changes:
    • Using new .keras model format in Tensorflow wherever applicable
    • Added use of Torch-TensorRT compilation/inference locally and on Spark to PyTorch notebooks

Environment separation:

  • Updated README for instructions on creating separate environments for Torch/Tensorflow to avoid CUDA conflicts.
  • Separated Huggingface examples into _torch/_tf versions for environment separation, and demonstrate model interoperability.

CI/CD:

  • Included Spark Session initialization to work with CI/CD pipeline.
  • Verified that all notebooks run error-free with jupyter nbconvert.

@rishic3 rishic3 marked this pull request as ready for review September 30, 2024 15:59
@rishic3
Copy link
Contributor Author

rishic3 commented Sep 30, 2024

@eordentlich @leewyang requesting a review - thanks!

Copy link
Collaborator

@eordentlich eordentlich left a comment

Choose a reason for hiding this comment

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

Really nice. Here is a preliminary set of comments. Will do another round after revisions.

Copy link
Collaborator

@leewyang leewyang left a comment

Choose a reason for hiding this comment

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

Minor nits, otherwise LGTM. Good work!

"2024-10-03 00:58:33.914094: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
"2024-10-03 00:58:33.919757: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"2024-10-03 00:58:34.259847: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try to resolve (E)rrors and (W)arnings (here and in other notebooks), if possible. Otherwise, maybe add a quick comment why this is expected/OK.

Copy link
Collaborator

@eordentlich eordentlich left a comment

Choose a reason for hiding this comment

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

Looks like a ton of work. Nice!
A few remaining minor comments/questions/suggestions.

"outputs": [],
"source": [
"spark.conf.set(\"spark.sql.execution.arrow.maxRecordsPerBatch\", \"512\")\n",
"# This line will fail if the vectorized reader runs out of memory\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the 'vectorized reader' and in general what is this line for? @leewyang

"spark.conf.set(\"spark.sql.execution.arrow.maxRecordsPerBatch\", \"512\")\n",
"# This line will fail if the vectorized reader runs out of memory\n",
"if int(spark.conf.get(\"spark.sql.execution.arrow.maxRecordsPerBatch\")) < 512:\n",
" print(\"Increasing `spark.sql.execution.arrow.maxRecordsPerBatch` to ensure the vectorized reader won't run out of memory\")\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Default is 10000 so this is decreasing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right decreasing. I guess this is meant to ensure the batches fit in the internal Arrow buffer, since each record is fairly large?

Copy link
Collaborator

@eordentlich eordentlich left a comment

Choose a reason for hiding this comment

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

👍

@eordentlich eordentlich merged commit fc23a57 into NVIDIA:branch-24.10 Oct 15, 2024
1 of 2 checks passed
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.

4 participants