Skip to content

Commit

Permalink
Module 2 CI example (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
truskovskiyk authored Jul 3, 2024
1 parent a7b18c2 commit 25cc2f4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/module-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Module 2


on:
workflow_dispatch:
# push:

pull_request:
branches:
- main

push:
branches:
- main

jobs:

Expand Down
2 changes: 0 additions & 2 deletions module-2/.dvc/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions module-2/.dvc/config

This file was deleted.

3 changes: 0 additions & 3 deletions module-2/.dvcignore

This file was deleted.

10 changes: 5 additions & 5 deletions module-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ Results.

| Name of Inference | Time (seconds) |
|----------------------|---------------------|
| Inference 1 worker | 12.90 |
| Inference 16 workers (ThreadPoolExecutor) | 0.86 |
| Inference 16 workers (ProcessPoolExecutor) | 3.88 |
| Inference with Ray | 2.15 |
| Inference 1 worker | 12.64 |
| Inference 16 workers (ThreadPoolExecutor) | 0.85 |
| Inference 16 workers (ProcessPoolExecutor) | 4.03 |
| Inference with Ray | 2.19 |


# Streaming dataset
Expand Down Expand Up @@ -240,4 +240,4 @@ python ./labeling/create_dataset_synthetic.py

## Updated design doc

[Google doc](https://docs.google.com/document/d/1dEzWd3pPozmU3AhMXjW3xcONUeNJee53djilN1A-wR8/edit)
[Google doc](https://docs.google.com/document/d/1dEzWd3pPozmU3AhMXjW3xcONUeNJee53djilN1A-wR8/edit)
1 change: 0 additions & 1 deletion module-2/data/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions module-2/data/big-data.csv.dvc

This file was deleted.

4 changes: 1 addition & 3 deletions module-2/processing/inference_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def run_inference(
model: DummyClassifier, x_test: np.ndarray, batch_size: int = 2048
) -> np.ndarray:
y_pred = []
y_batch = predict(model, x_test)

for i in tqdm(range(0, x_test.shape[0], batch_size)):
x_batch = x_test[i : i + batch_size]
Expand Down Expand Up @@ -156,7 +155,7 @@ def run_pool(inference_size: int = 100_000_000, max_workers: int = 16):


def run_ray(inference_size: int = 100_000_000, max_workers: int = 16):
ray.init()
ray.init(include_dashboard=True, dashboard_host='127.0.0.1', dashboard_port=5000)

x_train, y_train, x_test = get_data(inference_size=inference_size)
model = train_model(x_train, y_train)
Expand All @@ -165,7 +164,6 @@ def run_ray(inference_size: int = 100_000_000, max_workers: int = 16):
res = run_inference_ray_main(model=model, x_test=x_test, max_workers=max_workers)
print(f"Inference with Ray {time.monotonic() - s} result: {res.shape}")


def run_dask(inference_size: int = 100_000_000, max_workers: int = 16):
client = Client()

Expand Down

0 comments on commit 25cc2f4

Please sign in to comment.