Skip to content

Commit 9e26985

Browse files
authored
Merge branch 'main' into chore/get-pr-number-from-gh-action-event-file
2 parents 89410a5 + 8b2b37a commit 9e26985

21 files changed

+2521
-2908
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ jobs:
3434

3535
- name: 📦 Install dependencies (CLI)
3636
run: |
37-
uv tool install poetry
38-
uv venv
39-
source .venv/bin/activate
40-
poetry install --with dev
37+
uv sync
4138
4239
- name: ⚡️Codeflash Optimization
4340
id: optimize_code
4441
run: |
45-
source .venv/bin/activate
46-
poetry run codeflash --benchmark
42+
uv run codeflash --benchmark

.github/workflows/end-to-end-test-benchmark-bubblesort.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -62,13 +61,8 @@ jobs:
6261

6362
- name: Install dependencies (CLI)
6463
run: |
65-
uv tool install poetry
66-
uv venv
67-
source .venv/bin/activate
68-
poetry install --with dev
69-
64+
uv sync
7065
- name: Run Codeflash to optimize code
7166
id: optimize_code_with_benchmarks
7267
run: |
73-
source .venv/bin/activate
74-
poetry run python tests/scripts/end_to_end_test_benchmark_sort.py
68+
uv run python tests/scripts/end_to_end_test_benchmark_sort.py

.github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -61,11 +60,8 @@ jobs:
6160

6261
- name: Install dependencies (CLI)
6362
run: |
64-
uv tool install poetry
65-
uv venv
66-
source .venv/bin/activate
67-
poetry install --with dev
68-
63+
uv sync
64+
6965
- name: Remove .git
7066
run: |
7167
if [ -d ".git" ]; then
@@ -85,5 +81,4 @@ jobs:
8581
- name: Run Codeflash to optimize code
8682
id: optimize_code
8783
run: |
88-
source .venv/bin/activate
89-
poetry run python tests/scripts/end_to_end_test_bubblesort_pytest.py
84+
uv run python tests/scripts/end_to_end_test_bubblesort_pytest.py

.github/workflows/end-to-end-test-bubblesort-unittest.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -61,13 +60,9 @@ jobs:
6160

6261
- name: Install dependencies (CLI)
6362
run: |
64-
uv tool install poetry
65-
uv venv
66-
source .venv/bin/activate
67-
poetry install --with dev
63+
uv sync
6864
6965
- name: Run Codeflash to optimize code
7066
id: optimize_code
7167
run: |
72-
source .venv/bin/activate
73-
poetry run python tests/scripts/end_to_end_test_bubblesort_unittest.py
68+
uv run python tests/scripts/end_to_end_test_bubblesort_unittest.py

.github/workflows/end-to-end-test-coverage.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Coverage E2E
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -59,14 +58,10 @@ jobs:
5958

6059
- name: Install dependencies (CLI)
6160
run: |
62-
uv tool install poetry
63-
uv venv
64-
source .venv/bin/activate
65-
poetry install --with dev
66-
poetry add black # my-best-repo in end_to_end_test_coverage.py is configured to use black
61+
uv sync
62+
uv add black # my-best-repo in end_to_end_test_coverage.py is configured to use black
6763
6864
- name: Run Codeflash to optimize code
6965
id: optimize_code
7066
run: |
71-
source .venv/bin/activate
72-
poetry run python tests/scripts/end_to_end_test_coverage.py
67+
uv run python tests/scripts/end_to_end_test_coverage.py

.github/workflows/end-to-end-test-futurehouse.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -61,13 +60,9 @@ jobs:
6160

6261
- name: Install dependencies (CLI)
6362
run: |
64-
uv tool install poetry
65-
uv venv
66-
source .venv/bin/activate
67-
poetry install --with dev
63+
uv sync
6864
6965
- name: Run Codeflash to optimize code
7066
id: optimize_code
7167
run: |
72-
source .venv/bin/activate
73-
poetry run python tests/scripts/end_to_end_test_futurehouse.py
68+
uv run python tests/scripts/end_to_end_test_futurehouse.py

.github/workflows/end-to-end-test-init-optim.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87
workflow_dispatch:
@@ -60,13 +59,9 @@ jobs:
6059

6160
- name: Install dependencies (CLI)
6261
run: |
63-
uv tool install poetry
64-
uv venv
65-
source .venv/bin/activate
66-
poetry install --with dev
62+
uv sync
6763
6864
- name: Run Codeflash to optimize code
6965
id: optimize_code
7066
run: |
71-
source .venv/bin/activate
72-
poetry run python tests/scripts/end_to_end_test_init_optimization.py
67+
uv run python tests/scripts/end_to_end_test_init_optimization.py

.github/workflows/end-to-end-test-tracer-replay.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87
workflow_dispatch:
@@ -61,13 +60,9 @@ jobs:
6160

6261
- name: Install dependencies (CLI)
6362
run: |
64-
uv tool install poetry
65-
uv venv
66-
source .venv/bin/activate
67-
poetry install --with dev
63+
uv sync
6864
6965
- name: Run Codeflash to optimize code
7066
id: optimize_code
7167
run: |
72-
source .venv/bin/activate
73-
poetry run python tests/scripts/end_to_end_test_tracer_replay.py
68+
uv run python tests/scripts/end_to_end_test_tracer_replay.py

.github/workflows/end-to-end-topological-sort-test.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
# Use pull_request_target for everything to ensure access to secrets
5-
pull_request_target:
4+
pull_request:
65
paths:
76
- '**' # Trigger for all paths
87

@@ -86,13 +85,9 @@ jobs:
8685

8786
- name: Install dependencies (CLI)
8887
run: |
89-
uv tool install poetry
90-
uv venv
91-
source .venv/bin/activate
92-
poetry install --with dev
88+
uv sync
9389
9490
- name: Run Codeflash to optimize code
9591
id: optimize_code
9692
run: |
97-
source .venv/bin/activate
98-
poetry run python tests/scripts/end_to_end_test_topological_sort.py
93+
uv run python tests/scripts/end_to_end_test_topological_sort.py

.github/workflows/mypy.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ jobs:
2121
with:
2222
version: "0.5.30"
2323

24-
- name: install poetry as a tool
25-
run: uv tool install poetry
24+
- name: sync uv
25+
run: |
26+
uv sync
2627
27-
- name: install dependencies
28-
run: uvx poetry install --with dev
2928
3029
- name: Run mypy on allowlist
31-
run: uvx poetry run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt
30+
run: uv run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt

.github/workflows/unit-tests.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
version: "0.5.30"
28-
- name: install poetry as a tool
29-
run: uv tool install poetry
3028

3129
- name: install dependencies
32-
run: uvx poetry install --with dev
30+
run: uv sync
3331

3432
- name: Unit tests
35-
run: uvx poetry run pytest tests/ --benchmark-skip -m "not ci_skip"
33+
run: uv run pytest tests/ --benchmark-skip -m "not ci_skip"

code_to_optimize/code_directories/simple_tracer_e2e/workload.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,45 @@ def test_threadpool() -> None:
2121
for r in result:
2222
print(r)
2323

24+
class AlexNet:
25+
def __init__(self, num_classes=1000):
26+
self.num_classes = num_classes
27+
self.features_size = 256 * 6 * 6
28+
29+
def forward(self, x):
30+
features = self._extract_features(x)
31+
32+
output = self._classify(features)
33+
return output
34+
35+
def _extract_features(self, x):
36+
result = []
37+
for i in range(len(x)):
38+
pass
39+
40+
return result
41+
42+
def _classify(self, features):
43+
total = sum(features)
44+
return [total % self.num_classes for _ in features]
45+
46+
class SimpleModel:
47+
@staticmethod
48+
def predict(data):
49+
return [x * 2 for x in data]
50+
51+
@classmethod
52+
def create_default(cls):
53+
return cls()
54+
55+
def test_models():
56+
model = AlexNet(num_classes=10)
57+
input_data = [1, 2, 3, 4, 5]
58+
result = model.forward(input_data)
59+
60+
model2 = SimpleModel.create_default()
61+
prediction = model2.predict(input_data)
2462

2563
if __name__ == "__main__":
2664
test_threadpool()
65+
test_models()

0 commit comments

Comments
 (0)