Created
April 3, 2025 10:32
-
-
Save leslie-fang-intel/3e1d27b808b434caf11f8175b6c2b2af 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 torch | |
import sglang | |
import sgl_kernel | |
if __name__ == "__main__": | |
a = torch.randn((1, 1024), dtype=torch.float32).to("xpu") | |
ref_res = a + a | |
res3 = torch.ops.sgl_kernel.sgl_test_sycl(a, a) | |
print("ref_res is: {}".format(ref_res), flush=True) | |
print("res3 is: {}".format(res3), flush=True) | |
print(torch.testing.assert_allclose(ref_res, res3), flush=True) | |
print(torch.allclose(ref_res, res3), flush=True) | |
# print("Res is: {}".format(res), flush=True) | |
print("Done ----", flush=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment