NVIDIA TAO Toolkit v4.0
NVIDIA TAO Release tlt.40

REST API

The TAO Toolkit API exposes dataset and model endpoints for setting up and running actions.

User authentication is based on NGC API KEY.

Within the cluster, one can use the following command to know the node-port for the ingress controller. The node port would be the number after the 443 cluster port 443:<NodePort>.

Copy
Copied!
            

kubectl get services ingress-nginx-controller

the IP address would be the external IP of one of the cluster nodes.

..code:

Copy
Copied!
            

hostname -i

A curl command to do user authentication would look like the following, where 172.17.169.89 is one of the node’s external IP, 30108 is the NodePort for the ingress controller and the NGC API KEY is zZYtczM5amdtdDcwNjk0cnA2bGU2bXQ3bnQ6NmQ4NjNhMDItMTdmZS00Y2QxLWI2ZjktNmE5M2YxZTc0OGyM. This will return the user ID and token.

Copy
Copied!
            

curl https://172.17.169.89:30108/api/v1/login/zZYtczM5amdtdDcwNjk0cnA2bGU2bXQ3bnQ6NmQ4NjNhMDItMTdmZS00Y2QxLWI2ZjktNmE5M2YxZTc0OGyM

The following is a curl example of an API call with user authentication.

Copy
Copied!
            

curl https://172.17.169.89:30108/api/v1/user/6eba330c-1019-4644-82cc-80eb5273b867/model \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRJbkFzIjoiYWRtaW4iLCJpYXQiOjE0MjI3Nzk2Mz"

The TAO Toolkit API service includes methods for dealing with the content of experimental workspaces, such as user datasets and models. It also includes methods for executing TAO actions applicable to data and specifications stored in such experimental workspaces.

A basic scenario would be for a user to first create a Dataset for a specific network type, create a Model experiment that is pointing to the dataset and a pretrained model, and customize specs before executing network-related actions.

/api/v1/dataset

/api/v1/model

* List datasets for user
* Create a new dataset
* Delete a dataset
* Retrieve a dataset
* Update dataset metadata
* Retrieve default action specs
* Retrieve dataset action specs
* Update dataset action specs
* Run dataset actions
* Cancel dataset actions

* List models for user
* Create a new model
* Delete a model
* Retrieve a model
* Update model metadata
* Retrieve default action specs
* Retrieve model action specs
* Update current model specs
* Run model actions
* Early stop / Cancel model actions
* Pause training
* Resume training

See the TAO Toolkit API Reference for more details.

The tutorial notebooks provide examples that demonstrate the various workflows.

  1. Download the resource using the NGC CLI.

    Copy
    Copied!
                

    ngc registry resource download-version "nvidia/tao/tao-getting-started:4.0.0"


  2. Find tutorial notebooks (.ipynb files).

    Copy
    Copied!
                

    cd tao-getting-started_v4.0.0/notebooks/tao_api_starter_kit/api


  3. Serve these Notebook examples using Jupyter.

    Copy
    Copied!
                

    pip3 install jupyter notebook jupyter notebook --ip 0.0.0.0


© Copyright 2022, NVIDIA.. Last updated on Mar 23, 2023.