-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# What does this PR do? - [x] PixArt export support Alpha via CLI * Tiny ``` optimum-cli export neuron --model hf-internal-testing/tiny-pixart-alpha-pipe --batch_size 1 --height 64 --width 64 --num_images_per_prompt 1 --torch_dtype bfloat16 --sequence_length 32 pixart_alpha_neuron_tiny/ ``` * Regular ``` optimum-cli export neuron --model PixArt-alpha/PixArt-XL-2-512x512 --batch_size 1 --height 512 --width 512 --num_images_per_prompt 1 --torch_dtype bfloat16 --sequence_length 120 pixart_alpha_neuron_512/ ``` - [x] PixArt export support Alpha via API ```python import torch from optimum.neuron import NeuronPixArtAlphaPipeline # Compile model_id = "PixArt-alpha/PixArt-XL-2-512x512" compiler_args = {"auto_cast": "none"} input_shapes = {"batch_size": 1, "height": 512, "width": 512, "sequence_length": 120} neuron_model = NeuronPixArtAlphaPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16, export=True, disable_neuron_cache=True, **compiler_args, **input_shapes) # Save locally or upload to the HuggingFace Hub save_directory = "pixart_alpha_neuron_512/" neuron_model.save_pretrained(save_directory) ``` - [x] Caching support - [x] PixArt inference support ```python from optimum.neuron import NeuronPixArtAlphaPipeline # Inference neuron_model = NeuronPixArtAlphaPipeline.from_pretrained("pixart_alpha_neuron_512/") prompt = "An astronaut riding a green horse" image = neuron_model(prompt=prompt).images[0] image.save("out.png") ``` - [x] Tests - [x] Documentation ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you make sure to update the documentation with your changes? - [ ] Did you write any new necessary tests? --------- Co-authored-by: Michael Benayoun <[email protected]>
- Loading branch information
1 parent
62b6674
commit f44211c
Showing
37 changed files
with
622 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
|
||
def get_node_results(node_url): | ||
|
||
metrics = requests.get(node_url + "/metrics").text | ||
|
||
counters = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.