Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Conversation

rahul-tuli
Copy link
Member

@rahul-tuli rahul-tuli commented Mar 20, 2023

This PR adds a .create(...) function for ModelAnalysis, this makes it slightly easier to run ModelAnalysis on a variety of input:

 - [X] onnx models
 - [X] deployment directory
 - [X] SparseZoo Stubs
 - [X] yaml files and raw yaml strings

All of the above can now be used to create a ModelAnalysis, for example:

from sparsezoo.analyze import ModelAnalysis

path_or_stub = ... # SparseZoo stub or onnx model or deployment dir path or yaml file or raw yaml string
ModelAnalysis.create(path_or_stub)

Before this PR doing the same as above would require a cumbersome if-else ladder + error handling. that had the potential to be duplicated all across the codebase; this change now promotes one-source of truth for managing supported inputs

Created: a base to make analyze api args + options importable
Updated: `sparsezoo.analyze` cli to use the new importable `analyze_options`
@rahul-tuli rahul-tuli changed the title Feature Complete sparsezoo.analyze ModelAnalysis.create(...) Mar 21, 2023
@rahul-tuli rahul-tuli changed the base branch from main to analyze_cli_options March 21, 2023 10:11
Add tests for creation
Migrate `sparsezoo.analyze` to use `.create`
@rahul-tuli rahul-tuli force-pushed the analyze-compare-functionality branch 2 times, most recently from 6f1ed80 to 6567cc7 Compare March 21, 2023 10:32
@rahul-tuli rahul-tuli marked this pull request as ready for review March 21, 2023 11:16
bfineran
bfineran previously approved these changes Mar 21, 2023
Copy link
Contributor

@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.

lgtm pending minor comments

Base automatically changed from analyze_cli_options to main March 22, 2023 10:36
…ionality

# Conflicts:
#	src/sparsezoo/analyze/analysis.py
#	src/sparsezoo/analyze_cli.py
Merge: Main
Address: Review Comments
bfineran
bfineran previously approved these changes Mar 22, 2023
Copy link
Contributor

@corey-nm corey-nm left a comment

Choose a reason for hiding this comment

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

lgtm, nice changes 👍

@rahul-tuli rahul-tuli merged commit a1235b2 into main Mar 28, 2023
@rahul-tuli rahul-tuli deleted the analyze-compare-functionality branch March 28, 2023 08:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants