Distributed AI

Good to know: All Distributed AI interfaces need to use token as the request header.

Uploading Dataset

Upload the dataset to obtain a file path as a parameter of other APIs.

POST https://www.phoenix.global/sdk/computation/deAI/uploadFile

Upload a file to server

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Content-Type*

multipart/form-data

content type

Request Body

Name
Type
Description

file*

file

Dataset file

{
    "code":200,
    "msg":"[email protected]/2023-10-24T12:07:12Zy_train.csv"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/deAI/uploadFile' \
--header 'token: eyJhbGciOiJIUzIxxxxxxxxxxxxx' \
--form 'file=@"your local file path"'

Evaluating CCD Cost for CNN

POST https://www.phoenix.global/sdk/computation/deAI/queryGuarantee

Evaluate the number of ccds required for training CNN model

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

model*

string

Model name, which is CNN

epoch*

integer

The epoch for training

jobName*

string

Job name

x_train*

string

The path of the training dataset, obtained by calling the upload file api

y_train

string

The path of the label dataset, obtained by calling the upload file api

train_shard*

float

A decimal number greater than 0 and less than 1, indicating the proportion used for training

scale_ratio

integer

The number of colors in the picture

category*

int

Number of categories

channel

int

Image channel

The usage of curl and golang sdk is as follows:

Evaluating CCD Cost for LSTM

POST https://www.phoenix.global/sdk/computation/deAI/queryGuarantee

Evaluate the number of ccds required for training LSTM model

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

jobName*

string

Job name

model*

string

Model name, which is LSTM

epoch*

integer

The epoch for training

x_train*

string

The path of the training dataset, obtained by calling the upload file api

train_shard*

float

A decimal number greater than 0 and less than 1, indicating the proportion used for training

The usage of curl and golang sdk is as follows:

Creating a CNN Job

POST https://www.phoenix.global/sdk/computation/deAI/createJob

Creating a CNN job

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

jobName*

string

Job Name

batchSize*

integer

batch size

computation*

string

Computation type, which is Distributed AI

The usage of curl and golang sdk is as follows:

Creating a LSTM Job

POST https://www.phoenix.global/sdk/computation/deAI/createJob

Creating a LSTM Job

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

jobName*

string

Job name

batchSize

integer

batch size

computation

string

Computation type, which is Distributed AI

The usage of curl and golang sdk is as follows:

Evaluating CCD Cost for Inference

POST https://www.phoenix.global/sdk/computation/deAI/inferenceCost

Evaluating ccd cost for inference

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

data_path*

string

The path of the dataset, obtained by calling the upload file api

jobID*

string

The job id of a distributed AI job

The usage of curl and golang sdk is as follows:

Inference

POST https://www.phoenix.global/sdk/computation/deAI/inference

Inference

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

jobID*

string

The job id of a distributed AI job

The usage of curl and golang sdk is as follows:

Querying Inference Result

POST https://www.phoenix.global/sdk/computation/deAI/queryInfer

Querying a inference result by id

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

id*

string

The inference id, obtained by calling the inference api

The usage of curl and golang sdk is as follows:

Querying Inference Result List

POST https://www.phoenix.global/sdk/computation/deAI/queryInferList

Querying inference result list

Headers

Name
Type
Description

token*

string

The access token generated in the previous step

Request Body

Name
Type
Description

pageNo*

integer

Page number

pageSize*

integer

Page size

jobID*

string

Job id

The usage of curl and golang sdk is as follows: