Created
October 11, 2022 13:21
-
-
Save pashu123/984f945de06dde2230346b624de28026 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import numpy as np | |
from shark.shark_inference import SharkInference | |
from shark.shark_importer import SharkImporter | |
from shark.shark_downloader import download_torch_model | |
mlir_model, func_name, inputs, golden_out = download_torch_model( | |
"stable_diff_quant", tank_url="gs://shark_tank/prashant_nod" | |
) | |
shark_module = SharkInference(mlir_model, func_name, mlir_dialect="linalg", device="vulkan") | |
shark_module.compile() | |
result = shark_module.forward(inputs) | |
np.testing.assert_allclose(golden_out, result, rtol=1e-02, atol=1e-03) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment