Skip to content

Commit 2c44851

Browse files
authored
Fix packaging (quic#68)
* Fix pyproject.toml not including all source files Signed-off-by: Ilango Rajagopal <[email protected]> * Remove setup.py Signed-off-by: Ilango Rajagopal <[email protected]> * Added missing __init__.py files Signed-off-by: Ilango Rajagopal <[email protected]> * CI: Package install instead of editable install Signed-off-by: Ilango Rajagopal <[email protected]> * Remove duplicate code checkout stage Signed-off-by: Ilango Rajagopal <[email protected]> * Tests should not refer to ROOT_DIR Signed-off-by: Ilango Rajagopal <[email protected]> * Use direct path for test json files Signed-off-by: Ilango Rajagopal <[email protected]> * Add minimum version for setuptools Signed-off-by: Ilango Rajagopal <[email protected]> * Update installation instructions Signed-off-by: Ilango Rajagopal <[email protected]> --------- Signed-off-by: Ilango Rajagopal <[email protected]>
1 parent 8265edf commit 2c44851

File tree

10 files changed

+33
-64
lines changed

10 files changed

+33
-64
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.3.4
4+
rev: v0.5.2
55
hooks:
66
# Run the linter.
77
- id: ruff

QEfficient/compile/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -----------------------------------------------------------------------------
2+
#
3+
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
# -----------------------------------------------------------------------------
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -----------------------------------------------------------------------------
2+
#
3+
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
# -----------------------------------------------------------------------------

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,8 @@ System Requirements:
8989

9090
## Installation
9191
```bash
92-
# Create Python virtual env and activate it. (Required Python 3.8)
93-
94-
# Login to the Cloud AI 100 Server.
95-
ssh -X username@hostname
96-
97-
python3.8 -m venv qeff_env
98-
source qeff_env/bin/activate
99-
100-
# Clone the QEfficient Repo.
101-
102-
# Install the qefficient-library in Host machine (Used for CLI APIs) (Until we have docker integrated in Apps SDK)
103-
pip install -e .
92+
pip install -U pip
93+
pip install git+https://github.com/quic/efficient-transformers
10494
```
10595

10696
# Quick Start Guide

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ test = ["pytest","pytest-mock"]
3939
quality = ["black", "ruff", "hf_doc_builder@git+https://github.com/huggingface/doc-builder.git"]
4040

4141
[build-system]
42-
requires = ["setuptools"]
42+
requires = ["setuptools>=62.0.0"]
4343
build-backend = "setuptools.build_meta"
4444

45-
[tool.setuptools]
46-
packages = ["QEfficient"]
45+
[tool.setuptools.packages.find]
46+
include = ["QEfficient*"]
47+
namespaces = false
48+
49+
[tool.setuptools.dynamic.version]
50+
attr = "QEfficient.__version__"
4751

4852
[tool.ruff]
4953
line-length = 120

scripts/Jenkinsfile

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,16 @@ pipeline
1111

1212
stages
1313
{
14-
stage('Code Checkout')
15-
{
16-
steps
17-
{
18-
checkout scm
19-
}
20-
}
21-
stage('Env Activation')
22-
{
23-
steps
24-
{
25-
sh '''
26-
mkdir -p preflight_qeff
27-
python3.8 -m venv preflight_qeff
28-
. preflight_qeff/bin/activate
29-
'''
30-
}
31-
}
32-
stage('Install requirments')
14+
stage('Install QEfficient')
3315
{
3416
steps
3517
{
3618
sh '''
19+
python3.8 -m venv preflight_qeff
3720
. preflight_qeff/bin/activate
3821
pip install --upgrade pip setuptools
39-
pip install /opt/qti-aic/dev/lib/x86_64/qaic-0.0.1-py3-none-any.whl
40-
pip install -e .[test]
22+
pip install .[test]
23+
rm -rf QEfficient
4124
'''
4225
}
4326
}

setup.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/cloud/conftest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from QEfficient.generation.text_generation_inference import check_batch_size_and_num_prompts
1515
from QEfficient.utils import get_qpc_dir_path
16-
from QEfficient.utils.constants import QEFF_MODELS_DIR, ROOT_DIR, Constants
16+
from QEfficient.utils.constants import QEFF_MODELS_DIR, Constants
1717
from QEfficient.utils.logging_utils import logger
1818

1919

@@ -66,9 +66,7 @@ def __init__(
6666
self.model_name = model_name
6767
self.num_cores = num_cores
6868
self.prompt = prompt
69-
self.prompts_txt_file_path = (
70-
os.path.join(ROOT_DIR, prompts_txt_file_path) if prompts_txt_file_path is not None else None
71-
)
69+
self.prompts_txt_file_path = prompts_txt_file_path if prompts_txt_file_path is not None else None
7270
self.aic_enable_depth_first = aic_enable_depth_first
7371
self.mos = mos
7472
self.cache_dir = cache_dir
@@ -177,7 +175,7 @@ def pytest_generate_tests(metafunc):
177175
-----------
178176
Ref: https://docs.pytest.org/en/7.3.x/how-to/parametrize.html
179177
"""
180-
json_file = os.path.join(ROOT_DIR, "tests", "cloud", "high_level_testing.json")
178+
json_file = "tests/cloud/high_level_testing.json"
181179
with open(json_file, "r") as file:
182180
json_data = json.load(file)
183181

tests/transformers/models/test_causal_lm_models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
# -----------------------------------------------------------------------------
77

88
import json
9-
import os
109

1110
import pytest
1211
from transformers import AutoConfig, AutoModelForCausalLM
1312

14-
from QEfficient.utils.constants import ROOT_DIR, Constants
13+
from QEfficient.utils.constants import Constants
1514
from QEfficient.utils.device_utils import get_available_device_id
1615
from tests.utils import get_cloud_ai_100_tokens, set_up
1716

18-
TEST_CONFIG_FILE_PATH = os.path.join(ROOT_DIR, "tests", "config.json")
17+
TEST_CONFIG_FILE_PATH = "tests/config.json"
1918

2019

2120
def get_config(model_config):

tests/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from QEfficient.exporter.export_hf_to_cloud_ai_100 import qualcomm_efficient_converter
1616
from QEfficient.transformers.transform import transform_lm
1717
from QEfficient.utils import hf_download, load_hf_tokenizer
18-
from QEfficient.utils.constants import QEFF_MODELS_DIR, ROOT_DIR, Constants
18+
from QEfficient.utils.constants import QEFF_MODELS_DIR, Constants
1919
from QEfficient.utils.device_utils import get_available_device_id, is_multi_qranium_setup_available, is_qpc_size_gt_32gb
2020
from QEfficient.utils.run_utils import ApiRunner
2121

@@ -180,7 +180,7 @@ def get_cloud_ai_100_tokens(setup_info):
180180
if device_id:
181181
_, test_qpcs_path = compile_kv_model_on_cloud_ai_100(
182182
onnx_path=setup_info["onnx_model_path"],
183-
specializations_json=f"{ROOT_DIR}/scripts/specializations.json",
183+
specializations_json="scripts/specializations.json",
184184
num_cores=14,
185185
base_path=tests_qpc_dir,
186186
mxfp6=False,

0 commit comments

Comments
 (0)