-
Notifications
You must be signed in to change notification settings - Fork 1
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
End-to-End examples with MIGraphX #154
Comments
Llama-2To test it with MIGraphX we can update these two apps:
Currently this version of llama-2 does not compile |
WhisperORT versionThe original repo uses pytorch, but there is a repo here with onnxruntime. Currently only the encoder compiles. The decoder fails with the following: Hugging FaceIt requires modifications to export with optimum. The attention_mask is not exposed by default. A WIP example script to use the model. |
Stable DiffusionpythonPyTorch example in python c++GGML example in C++ DockerThis dockerfile can be used for testing these examples. |
FP16Currently not everything works with half precision. Stable DiffusionTextEncoder and VAE-Decoder works Unet results in The problem occurs here:
RefThe reference implementation shows the same issue: fp32Run instruction: @6525 = ref::dot(@6521,@6524) -> float_type, {5, 4096, 4096}, {16777216, 4096, 1}, target_id=0
Time: 1561.65ms, 1561.65ms
Output has normal
Output: -453921, -447240, -438036, -430549, -439314, ..., -192728, -190610, -185909, -184388, -183079
Min value: -742234, Max value: 230521, Mean: -368671, StdDev: 153924 fp16Run instruction: @4528 = ref::dot(@4517,@4527) -> half_type, {5, 4096, 4096}, {16777216, 4096, 1}, target_id=0
Time: 1508.01ms, 1508.01ms
Output has normal, inf
Output: -inf, -inf, -inf, -inf, -inf, ..., -inf, -inf, -inf, -inf, -inf
Min value: -inf, Max value: inf, Mean: -nan, StdDev: -nan Llama-2Looking at the results, the Run instruction: @640 = ref::multibroadcast[out_lens={1, 32, 256, 256},out_dyn_dims={}](@562) -> float_type, {1, 32, 256, 256}, {65536, 0, 256, 1}, target_id=0
Time: 0.00487ms, 0.00491ms
Output has inf, normal, zero
Output: 0, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, ..., -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38
Min value: -inf, Max value: 0, Mean: -inf, StdDev: -nan
Run instruction: @641 = ref::contiguous(@640) -> float_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 47.8585ms, 47.8587ms
Output has inf, normal, zero
Output: 0, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, ..., -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38
Min value: -inf, Max value: 0, Mean: -inf, StdDev: -nan
Run instruction: @642 = ref::add(@639,@641) -> float_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 8.60302ms, 8.60312ms
Output has inf, normal
Output: 2.53309, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, ..., -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38, -3.40282e+38
Min value: -inf, Max value: 9.41974, Mean: -inf, StdDev: -nan
Run instruction: @643 = ref::softmax[axis=3](@642) -> float_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 7.95904ms, 7.95916ms
Output has zero, normal
Output: 1, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0
Min value: 0, Max value: 1, Mean: 0.00390625, StdDev: 0.0240073 The Run instruction: @355 = ref::multibroadcast[out_lens={1, 32, 256, 256},out_dyn_dims={}](@287) -> half_type, {1, 32, 256, 256}, {65536, 0, 256, 1}, target_id=0
Time: 0.0025ms, 0.00254ms
Output has inf, normal, zero
Output: 0, -65504, -65504, -65504, -65504, ..., -65504, -65504, -65504, -65504, -65504
Min value: -inf, Max value: 0, Mean: -inf, StdDev: -nan
Run instruction: @356 = ref::contiguous(@355) -> half_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 43.9691ms, 43.9692ms
Output has inf, normal, zero
Output: 0, -65504, -65504, -65504, -65504, ..., -65504, -65504, -65504, -65504, -65504
Min value: -inf, Max value: 0, Mean: -inf, StdDev: -nan
Run instruction: @357 = ref::add(@354,@356) -> half_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 2.98311ms, 2.98321ms
Output has zero, inf, normal
Output: 2.53516, -65472, -65472, -65472, -65472, ..., -65504, -65504, -65504, -65504, -65504
Min value: -inf, Max value: 9.42188, Mean: -inf, StdDev: -nan
Run instruction: @358 = ref::softmax[axis=3](@357) -> half_type, {1, 32, 256, 256}, {2097152, 65536, 256, 1}, target_id=0
Time: 5.48778ms, 5.48788ms
Output has zero, normal
Output: 1, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0
Min value: 0, Max value: 1, Mean: 0.00390506, StdDev: 0.0239995 But there are The first 6 of 65 pows with Run instruction: @566 = ref::pow(@563,@565) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 4.5869ms, 4.58699ms
Output has zero, normal
Output: 3.38076e-06, 1.45519e-05, 9.24105e-07, 8.58307e-06, 1.59824e-05, ..., 2.50679e-11, 5.13012e-12, 6.96332e-13, 4.14389e-11, 7.99361e-13
Min value: 0, Max value: 0.0178995, Mean: 4.2016e-06, StdDev: 6.058e-05
Run instruction: @657 = ref::pow(@654,@656) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 3.02639ms, 3.0265ms
Output has normal
Output: 9.25549e-05, 0.00138359, 5.57778e-05, 0.000400907, 0.00149003, ..., 5.14963e-05, 0.000458215, 1.88229e-06, 1.4133e-05, 0.000107119
Min value: 1.5283e-12, Max value: 0.564558, Mean: 0.000190222, StdDev: 0.0029691
Run instruction: @689 = ref::pow(@686,@688) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 3.2122ms, 3.21228ms
Output has normal
Output: 0.000135018, 0.000127227, 0.00313293, 0.0010952, 0.0218154, ..., 0.00161709, 0.20428, 6.98841e-05, 0.00672539, 0.00149917
Min value: 3.36059e-12, Max value: 22.6929, Mean: 0.0111376, StdDev: 0.255466
Run instruction: @780 = ref::pow(@777,@779) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 2.8067ms, 2.80677ms
Output has normal
Output: 0.000343903, 0.00054023, 0.00646422, 0.00035014, 0.0129346, ..., 6.03671e-05, 0.142149, 0.00201874, 0.00681912, 0.00107211
Min value: 2.72005e-15, Max value: 13.7998, Mean: 0.00849891, StdDev: 0.200751
Run instruction: @812 = ref::pow(@809,@811) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 3.50274ms, 3.50282ms
Output has normal
Output: 0.00488131, 0.261523, 0.00412025, 0.00380722, 0.00340024, ..., 1.33656e-05, 0.0975391, 0.00262303, 0.0078206, 0.00041745
Min value: 1.38778e-15, Max value: 569485, Mean: 2.79251, StdDev: 629.777
Run instruction: @903 = ref::pow(@900,@902) -> float_type, {1, 256, 4096}, {1048576, 4096, 1}, target_id=0
Time: 2.96483ms, 2.96493ms
Output has normal
Output: 0.00556073, 0.258198, 0.00398735, 0.00294377, 0.00266523, ..., 0.0058447, 0.124247, 1.0684e-05, 0.00872876, 0.000976011
Min value: 4.996e-16, Max value: 569493, Mean: 2.80136, StdDev: 629.854 And the same ones with
|
Tracking issue for creating (complex) E2E (End-to-End) example apps using MIGraphX
The text was updated successfully, but these errors were encountered: