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 JavaScript/TypeScript + TensorFlow.js kernel example #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

athewsey
Copy link
Contributor

Issue #, if available: N/A

Description of changes:

  • Propose a new example for JS/TS kernel with TensorFlow.js, CUDA support
  • Some minor tweaks to the global README (Add doc link; Remove redundant "This example" from descriptions; add trailing newline; Bump the "One-time setup" header up to L3 since L4 doesn't render great and there's no real reason for the extra hierarchy in this case?)

To aim for working GPU support, the new example uses a similar approach to the AWS TensorFlow v2.4 GPU training DLC: building from an nvidia/cuda:11.0-base-ubuntu, with similar library installs and base Python setup.

However, many of the more SageMaker training-specific or core TensorFlow-specific items are skipped out: E.g. Python TensorFlow install, MPI/Horovod, SMDistributed, SSH, Boost, etc... Just leaving a few utilities like AWS CLI and the high-level SageMaker SDKs in case users want to use them.

On top of this base, NodeJS and tslab are installed (Providing Jupyter kernels for either JavaScript or TypeScript) - and TensorFlow.js (CPU and GPU versions) + the AWS SDK for JS are pre-installed.

Very open to feedback on the approach: It does yield pretty long build times (esp since the Python is built from source) and big containers (~3400MB according to my ECR)... but I thought sticking close to the DLC's approach was likely to give good driver compatibility results; and directly inheriting from the DLC would have resulted in significant extras and user complexity (having to look up the correct account ID for your region, and do another ECR login)

Testing:

I've built the container and successfully attached it to SMStudio both by the jslab and tslab kernels, which generally seem to work OK. Not quite got the TensorFlow.js MNIST example working via notebook yet, but can use the kernels and import the libraries correctly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

JavaScript/TypeScript kernel image based on CUDA, with TensorFlow.js
and some AWS/SageMaker convenience utilities installed.
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.

1 participant