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

sparsify.init CLI to create an project/experiment #192

Merged
merged 18 commits into from
May 12, 2023

Conversation

rahul-tuli
Copy link
Member

@rahul-tuli rahul-tuli commented Apr 17, 2023

This PR represents the base feature branch for sparsify.init cli push

Usage: sparsify.init [OPTIONS]
  sparsify.init CLI utility to initialize an experiment such that it will
  provision all local and cloud resources necessary, additionally also allows
  users to update hyper-param(s) before applying
Options:
  --experiment-type [sparse-transfer|one-shot|training-aware]
                                  The type of the experiment to run
  --use-case [image_classification|object_detection|question_answering|
  segmentation|sentiment_analysis|text_classification|token_classification]
                                  The task this model is for
  --project-id TEXT               Id of the project this run belongs to.
  --experiment-id TEXT            Id of the experiment this run belongs to.
  --working-dir TEXT              Path to save the deployment ready model to.
  --model TEXT                    Path to model
  --model-id TEXT                 sparsify model id
  --data TEXT                     Path to dataset folder containing training
                                  data and optionally validation data
  --eval-metric [kl|accuracy|mAP|recall|f1]
                                  Metric that the model is evaluated against
                                  on the task. None means it is based on
                                  --use-case.  [default: kl]
  --train-samples INTEGER         Number of samples to use from the dataset
                                  for processing. None means the entire
                                  dataset.
  --val-samples INTEGER           Number of samples to use from the dataset
                                  for processing. None means the entire
                                  dataset.
  --help                          Show this message and exit.  [default:
                                  False]

@rahul-tuli rahul-tuli self-assigned this Apr 17, 2023
@rahul-tuli rahul-tuli changed the base branch from main to sparsify.alpha April 17, 2023 14:18
@rahul-tuli rahul-tuli force-pushed the sparsify.init-cli branch 2 times, most recently from 71fd8e8 to 2561abd Compare April 29, 2023 10:38
@rahul-tuli rahul-tuli changed the title [WIP] sparsify.init CLI to create an project/experiment sparsify.init CLI to create an project/experiment Apr 30, 2023
@rahul-tuli rahul-tuli requested a review from tdg5 April 30, 2023 13:23
@rahul-tuli rahul-tuli marked this pull request as ready for review April 30, 2023 13:23
Copy link
Contributor

@KSGulin KSGulin left a comment

Choose a reason for hiding this comment

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

Code looks good! Left some comments on the CLI

src/sparsify/cli/init.py Outdated Show resolved Hide resolved
src/sparsify/cli/init.py Outdated Show resolved Hide resolved
KSGulin
KSGulin previously approved these changes May 1, 2023
src/sparsify/cli/init.py Outdated Show resolved Hide resolved
src/sparsify/cli/init.py Outdated Show resolved Hide resolved
src/sparsify/cli/init.py Outdated Show resolved Hide resolved
src/sparsify/cli/init.py Outdated Show resolved Hide resolved
@rahul-tuli rahul-tuli changed the base branch from sparsify.alpha to sparsify.beta May 9, 2023 07:47
* Add a hidden debug option
* [Add] Create model_id
* [Add] Create experiment
* [Add] Create Project
* [Move] Healthcheck logging to the respective function
* [Add] Create analysis
* Save analysis.yaml to working dir
* Address review comments from @bfineran and @KSGulin

TODO: refactor get and post requests to a Sparsify client class
* * Add SparsifyCredentials class to manage sparsify credentials and access/id tokens
* Update sparsify.login and sparsify.init to use this class
* Add Tests for sdparsify.login
* Add Tests for SparsifyCredentials

* Add Sparsify Client
Add SparsifySession
Add decorator for debug logging
Check for existence before creating new projects/experiments/models
Check if experiment initialization pending before running through
Extract core init functionality to an importable function
@rahul-tuli rahul-tuli mentioned this pull request May 9, 2023
Copy link
Member

@bfineran bfineran left a comment

Choose a reason for hiding this comment

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

Great work - please review comments and let me know if you have any questions

src/sparsify/init.py Outdated Show resolved Hide resolved
src/sparsify/init.py Outdated Show resolved Hide resolved
src/sparsify/init.py Outdated Show resolved Hide resolved
src/sparsify/init.py Outdated Show resolved Hide resolved
src/sparsify/login.py Show resolved Hide resolved
src/sparsify/utils/helpers.py Outdated Show resolved Hide resolved
src/sparsify/utils/helpers.py Outdated Show resolved Hide resolved
src/sparsify/utils/helpers.py Outdated Show resolved Hide resolved
src/sparsify/utils/helpers.py Outdated Show resolved Hide resolved
src/sparsify/utils/helpers.py Outdated Show resolved Hide resolved
* Move Client related code to a separate file `client.py`
* Move Credentials creation to SparsifyClient
* Add native support to read api-key from environment variable
* Create requested helper methods
* Update debug logs to use string formatting
* create properties for access token and user info
Add doctest(s)
@rahul-tuli rahul-tuli marked this pull request as ready for review May 12, 2023 11:13
Copy link
Contributor

@KSGulin KSGulin left a comment

Choose a reason for hiding this comment

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

Great stuff!

src/sparsify/utils/client.py Show resolved Hide resolved
@rahul-tuli rahul-tuli merged commit d04d96d into sparsify.beta May 12, 2023
@rahul-tuli rahul-tuli deleted the sparsify.init-cli branch May 12, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants