Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix xpu version itrex detect
Browse files Browse the repository at this point in the history
  • Loading branch information
zhewang1-intc committed Jun 27, 2024
1 parent 8c0242e commit 655791e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions intel_extension_for_transformers/qbits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
# limitations under the License.

import torch
if not torch.xpu._is_compiled():
from intel_extension_for_transformers.qbits_py import * # pylint: disable=E0401, E0611
import intel_extension_for_transformers
if "gpu" in intel_extension_for_transformers.__version__:
from intel_extension_for_transformers.qbits_py import * # pylint: disable=E0401, E0611
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
from pathlib import Path
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
from setuptools_scm import get_version

result = subprocess.Popen("pip install -r requirements.txt", shell=True)
result.wait()


def is_intel_gpu_available():
import torch
import intel_extension_for_pytorch as ipex
Expand Down Expand Up @@ -286,6 +288,9 @@ def check_submodules():
"intel_extension_for_transformers/transformers/runtime/"),
])
cmdclass = {'build_ext': CMakeBuild}
itrex_version = get_version()
if IS_INTEL_GPU:
itrex_version = itrex_version + "-gpu"

setup(
name="intel-extension-for-transformers",
Expand Down Expand Up @@ -324,4 +329,5 @@ def check_submodules():
],
setup_requires=['setuptools_scm'],
use_scm_version=True,
version=itrex_version
)

0 comments on commit 655791e

Please sign in to comment.