aiauto-client 0.1.7__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/PKG-INFO +12 -1
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/README.md +11 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/examples/example_torch_multiple_objective.py +1 -1
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/examples/example_torch_single_objective.py +1 -1
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/examples/simple_example.py +3 -2
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/pyproject.toml +1 -1
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/core.py +81 -4
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto_client.egg-info/PKG-INFO +12 -1
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/MANIFEST.in +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/setup.cfg +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/__init__.py +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/_config.py +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/constants.py +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/http_client.py +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto/serializer.py +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto_client.egg-info/SOURCES.txt +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto_client.egg-info/dependency_links.txt +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto_client.egg-info/requires.txt +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/src/aiauto_client.egg-info/top_level.txt +0 -0
- {aiauto_client-0.1.7 → aiauto_client-0.1.9}/tests/test_local_storage.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aiauto-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9
|
4
4
|
Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
|
5
5
|
Author-email: AIAuto Team <ainode@zeroone.ai>
|
6
6
|
Project-URL: Homepage, https://dashboard.aiauto.pangyo.ainode.ai
|
@@ -94,6 +94,17 @@ study_wrapper.optimize(
|
|
94
94
|
runtime_image=aiauto.RUNTIME_IMAGES[0],
|
95
95
|
)
|
96
96
|
```
|
97
|
+
- 종료 됐는지 optuna-dashboard 가 아닌 코드로 확인하는 법
|
98
|
+
```python
|
99
|
+
study_wrapper.get_status()
|
100
|
+
# {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
|
101
|
+
while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
|
102
|
+
sleep(10) # 10초 마다 한 번 씩
|
103
|
+
```
|
104
|
+
- best trial 을 가져오는 법
|
105
|
+
```python
|
106
|
+
TODO
|
107
|
+
```
|
97
108
|
|
98
109
|
## Jupyter Notebook 사용 시 주의사항
|
99
110
|
|
@@ -67,6 +67,17 @@ study_wrapper.optimize(
|
|
67
67
|
runtime_image=aiauto.RUNTIME_IMAGES[0],
|
68
68
|
)
|
69
69
|
```
|
70
|
+
- 종료 됐는지 optuna-dashboard 가 아닌 코드로 확인하는 법
|
71
|
+
```python
|
72
|
+
study_wrapper.get_status()
|
73
|
+
# {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
|
74
|
+
while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
|
75
|
+
sleep(10) # 10초 마다 한 번 씩
|
76
|
+
```
|
77
|
+
- best trial 을 가져오는 법
|
78
|
+
```python
|
79
|
+
TODO
|
80
|
+
```
|
70
81
|
|
71
82
|
## Jupyter Notebook 사용 시 주의사항
|
72
83
|
|
@@ -27,7 +27,7 @@ ac = aiauto.AIAutoController('<token>')
|
|
27
27
|
|
28
28
|
|
29
29
|
# multi objective without pruning (accuracy + FLOPS)
|
30
|
-
def objective_multi(trial
|
30
|
+
def objective_multi(trial):
|
31
31
|
"""
|
32
32
|
다중 목적 함수: accuracy 최대화 + FLOPS 최소화
|
33
33
|
hyper parameter tuning을 할 때는 데이터의 일부만 사용하여 빠르게 HPO를 한다
|
@@ -27,7 +27,7 @@ ac = aiauto.AIAutoController('<token>')
|
|
27
27
|
|
28
28
|
|
29
29
|
# single objective accuracy with pruning
|
30
|
-
def objective_single(trial
|
30
|
+
def objective_single(trial):
|
31
31
|
"""
|
32
32
|
단일 목적 함수: accuracy 최대화
|
33
33
|
hyper parameter tuning 할 때는 데이터의 일부만 사용하여 빠르게 HPO를 한다
|
@@ -11,7 +11,6 @@
|
|
11
11
|
$ python simple_example.py
|
12
12
|
"""
|
13
13
|
|
14
|
-
import optuna
|
15
14
|
import aiauto
|
16
15
|
|
17
16
|
|
@@ -26,7 +25,9 @@ ac = aiauto.AIAutoController('<token>')
|
|
26
25
|
|
27
26
|
|
28
27
|
# single objective accuracy
|
29
|
-
def simple_objective(trial
|
28
|
+
def simple_objective(trial):
|
29
|
+
import optuna
|
30
|
+
import aiauto
|
30
31
|
"""
|
31
32
|
간단한 2차 함수 최적화
|
32
33
|
(x - 2)^2 + (y - 3)^2 를 최소화
|
@@ -31,8 +31,16 @@ class AIAutoController:
|
|
31
31
|
if not host_external:
|
32
32
|
raise RuntimeError("No storage host returned from EnsureWorkspace")
|
33
33
|
|
34
|
-
host
|
35
|
-
|
34
|
+
# Parse host and port
|
35
|
+
if ':' in host_external:
|
36
|
+
host, port_str = host_external.rsplit(':', 1)
|
37
|
+
port = int(port_str)
|
38
|
+
else:
|
39
|
+
host = host_external
|
40
|
+
port = 443 # Default to HTTPS port
|
41
|
+
|
42
|
+
# Create storage with TLS support for port 443
|
43
|
+
self.storage = self._create_storage_with_tls(host, port)
|
36
44
|
|
37
45
|
# Store the internal host for CRD usage (if needed later)
|
38
46
|
self.storage_host_internal = response.get('journalGrpcStorageProxyHostInternal', '')
|
@@ -49,6 +57,74 @@ class AIAutoController:
|
|
49
57
|
self.artifact_store = optuna.artifacts.FileSystemArtifactStore('./artifacts')
|
50
58
|
self.tmp_dir = tempfile.mkdtemp(prefix=f'ai_auto_tmp_')
|
51
59
|
|
60
|
+
def _create_storage_with_tls(self, host: str, port: int):
|
61
|
+
"""Create GrpcStorageProxy with automatic TLS detection based on port"""
|
62
|
+
# Port 13000 = internal (plain), Port 443 = external (TLS)
|
63
|
+
if port != 443:
|
64
|
+
# Plain gRPC for internal connections
|
65
|
+
return optuna.storages.GrpcStorageProxy(host=host, port=port)
|
66
|
+
|
67
|
+
# TLS connection for external access (port 443)
|
68
|
+
import grpc
|
69
|
+
creds = grpc.ssl_channel_credentials()
|
70
|
+
|
71
|
+
# Try different TLS parameter names for Optuna version compatibility
|
72
|
+
# Try 1: channel_credentials parameter (newer Optuna versions)
|
73
|
+
try:
|
74
|
+
return optuna.storages.GrpcStorageProxy(
|
75
|
+
host=host,
|
76
|
+
port=port,
|
77
|
+
channel_credentials=creds
|
78
|
+
)
|
79
|
+
except TypeError:
|
80
|
+
pass
|
81
|
+
|
82
|
+
# Try 2: ssl boolean parameter
|
83
|
+
try:
|
84
|
+
return optuna.storages.GrpcStorageProxy(
|
85
|
+
host=host,
|
86
|
+
port=port,
|
87
|
+
ssl=True
|
88
|
+
)
|
89
|
+
except TypeError:
|
90
|
+
pass
|
91
|
+
|
92
|
+
# Try 3: use_tls parameter
|
93
|
+
try:
|
94
|
+
return optuna.storages.GrpcStorageProxy(
|
95
|
+
host=host,
|
96
|
+
port=port,
|
97
|
+
use_tls=True
|
98
|
+
)
|
99
|
+
except TypeError:
|
100
|
+
pass
|
101
|
+
|
102
|
+
# Try 4: secure parameter
|
103
|
+
try:
|
104
|
+
return optuna.storages.GrpcStorageProxy(
|
105
|
+
host=host,
|
106
|
+
port=port,
|
107
|
+
secure=True
|
108
|
+
)
|
109
|
+
except TypeError:
|
110
|
+
pass
|
111
|
+
|
112
|
+
# Fallback: try to create secure channel manually
|
113
|
+
try:
|
114
|
+
channel = grpc.secure_channel(f"{host}:{port}", creds)
|
115
|
+
# Some Optuna versions might accept a channel directly
|
116
|
+
return optuna.storages.GrpcStorageProxy(channel=channel)
|
117
|
+
except (TypeError, AttributeError):
|
118
|
+
pass
|
119
|
+
|
120
|
+
# If all attempts fail, raise informative error
|
121
|
+
raise RuntimeError(
|
122
|
+
f"Failed to create TLS connection to {host}:{port}. "
|
123
|
+
"GrpcStorageProxy TLS parameters not recognized. "
|
124
|
+
"Please check Optuna version compatibility. "
|
125
|
+
"Tried: channel_credentials, ssl, use_tls, secure, channel parameters."
|
126
|
+
)
|
127
|
+
|
52
128
|
def get_storage(self):
|
53
129
|
return self.storage
|
54
130
|
|
@@ -172,7 +248,7 @@ class StudyWrapper:
|
|
172
248
|
self._study = optuna.create_study(
|
173
249
|
study_name=self.study_name,
|
174
250
|
storage=self._storage,
|
175
|
-
load_if_exists=True
|
251
|
+
load_if_exists=True,
|
176
252
|
)
|
177
253
|
except Exception as e:
|
178
254
|
raise RuntimeError(
|
@@ -202,7 +278,8 @@ class StudyWrapper:
|
|
202
278
|
request_data = {
|
203
279
|
"objective": {
|
204
280
|
"sourceCode": serialize(objective),
|
205
|
-
"requirementsTxt": build_requirements(requirements_file, requirements_list)
|
281
|
+
"requirementsTxt": build_requirements(requirements_file, requirements_list),
|
282
|
+
"objectiveName": objective.__name__ # 함수명 추출하여 전달
|
206
283
|
},
|
207
284
|
"batch": {
|
208
285
|
"studyName": self.study_name,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aiauto-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9
|
4
4
|
Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
|
5
5
|
Author-email: AIAuto Team <ainode@zeroone.ai>
|
6
6
|
Project-URL: Homepage, https://dashboard.aiauto.pangyo.ainode.ai
|
@@ -94,6 +94,17 @@ study_wrapper.optimize(
|
|
94
94
|
runtime_image=aiauto.RUNTIME_IMAGES[0],
|
95
95
|
)
|
96
96
|
```
|
97
|
+
- 종료 됐는지 optuna-dashboard 가 아닌 코드로 확인하는 법
|
98
|
+
```python
|
99
|
+
study_wrapper.get_status()
|
100
|
+
# {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
|
101
|
+
while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
|
102
|
+
sleep(10) # 10초 마다 한 번 씩
|
103
|
+
```
|
104
|
+
- best trial 을 가져오는 법
|
105
|
+
```python
|
106
|
+
TODO
|
107
|
+
```
|
97
108
|
|
98
109
|
## Jupyter Notebook 사용 시 주의사항
|
99
110
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|