Experiment tracking involves systematically recording and managing details of machine learning experiments, such as code, data, configurations, parameters, metrics, and results. It ensures reproducibility, comparability, and accountability across experiments, aiding in efficient model development and deployment. Weights & Biases (wandb) is one approach to achieving this.
Follow these instructions to log experiments to your wandb account.
To enable seamless integration with wandb in your experiments, follow these steps to create the wandb secret:
flexai secret create command to store your wandb API key as a secret. Replace <WANDB_API_KEY_SECRET_NAME> with your desired name for the secret: flexai secret create <WANDB_API_KEY_SECRET_NAME>
Then past your wandb API key value.You can now log experiments to your wandb account by adding the following flags to any flexai training run command:
--secret WANDB_API_KEY=<WANDB_API_KEY_SECRET_NAME> --env WANDB_PROJECT=<YOUR_PROJECT_NAME>You can optionally set your run name using the --run_name <YOUR_RUN_NAME> HuggingFace arg.
For more ways to customize and configure your wandb environment, check out the Weights & Biases Environment Variables Guide.
If you haven't already connected FlexAI to GitHub, you'll need to set up a code registry connection:
flexai code-registry connectThis will allow FlexAI to pull repositories directly from GitHub using the -u flag in training commands.
In this experiment, we will use a pre-processed version of the wikitext dataset that has been set up for the GPT-2 model.
DATASET_NAME=gpt2-tokenized-wikitext && curl -L -o ${DATASET_NAME}.zip "https://bucket-docs-samples-99b3a05.s3.eu-west-1.amazonaws.com/${DATASET_NAME}.zip" && unzip ${DATASET_NAME}.zip && rm ${DATASET_NAME}.zipgpt2-tokenized-wikitext/) to FlexAI:flexai dataset push gpt2-tokenized-wikitext --file gpt2-tokenized-wikitextNow that all the pieces are in place (wandb Secret, Source, and Dataset), you can run the training job with experiment tracking enabled.
flexai training run gpt2training-tracker --repository-url https://github.com/flexaihq/experiments --dataset gpt2-tokenized-wikitext --secret WANDB_API_KEY=<WANDB_API_KEY_SECRET_NAME> --env WANDB_PROJECT=<YOUR_PROJECT_NAME> --requirements-path code/causal-language-modeling/requirements.txt \
-- code/causal-language-modeling/train.py \
--do_eval \
--do_train \
--dataset_name wikitext \
--tokenized_dataset_load_dir /input/gpt2-tokenized-wikitext \
--model_name_or_path openai-community/gpt2 \
--output_dir /output-checkpoint \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 8 \
--logging_steps 50 \
--save_steps 500 \
--eval_steps 500 \
--eval_strategy steps \
--run_name <YOUR_RUN_NAME>You can now visit your wandb dashboard and look for your project's name to follow the progress of the Training Job and analyze its results in near real-time.

To celebrate this launch we’re offering €100 starter credits for first-time users!
Get Started Now