Skip to content

Commit b309066

Browse files
authored
Update Training Container (#18)
* fixed merge * update to pipeline version v0.0.5 bfore release * updates * log incremental * fix incremental
1 parent 58fa6c8 commit b309066

File tree

13 files changed

+20
-18
lines changed

13 files changed

+20
-18
lines changed

bring-your-own-model/PDK_implementation/pipelines/_on_prem_training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir bring-your-own-model/PDK_implementation/experiment --config const.yaml --repo customer-churn-data --model customer-churn --project pdk-customer-churn"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

bring-your-own-model/PDK_implementation/pipelines/training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir bring-your-own-model/PDK_implementation/experiment --config const.yaml --repo customer-churn-data --model customer-churn --project pdk-customer-churn"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/brain-mri/pipelines/_on_prem_training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/brain-mri/experiment --config const.yaml --repo brain-mri-data --model brain-mri --project pdk-brain-mri"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/brain-mri/pipelines/training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/brain-mri/experiment --config const.yaml --repo brain-mri-data --model brain-mri --project pdk-brain-mri"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/dog-cat/pipelines/_on_prem_training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/dog-cat/experiment --config const.yaml --repo dogs-and-cats-data --model dogs-and-cats --project pdk-dogs-and-cats"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/dog-cat/pipelines/training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/dog-cat/experiment --config const.yaml --repo dogs-and-cats-data --model dogs-and-cats --project pdk-dogs-and-cats"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/object-detection/pipelines/_on_prem_training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/object-detection/experiment --config const.yaml --repo object-detection-data --model object-detection --project pdk-object-detection --incremental false"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/object-detection/pipelines/training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/object-detection/experiment --config const.yaml --repo object-detection-data --model object-detection --project pdk-object-detection --incremental false"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/sentiment-analysis/pipelines/_on_prem_training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/sentiment-analysis/experiment --config const.yaml --repo finbert-prep --model finbert --project pdk-finbert"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/sentiment-analysis/pipelines/training-pipeline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"stdin": [
2020
"python train.py --git-url https://[email protected]:/determined-ai/pdk.git --git-ref main --sub-dir examples/sentiment-analysis/experiment --config const.yaml --repo finbert-prep --model finbert --project pdk-finbert"
2121
],
22-
"image": "pachyderm/pdk:train-v0.0.4",
22+
"image": "pachyderm/pdk:train-v0.0.5",
2323
"secrets": [
2424
{
2525
"name": "pipeline-secret",

examples/training_container/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9
1+
FROM python:3.10
22

33
WORKDIR /app
44

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
determined==0.26.7
2-
PyYAML==5.4.1
3-
ruamel.yaml==0.17.40
1+
2+
determined==0.27.0
3+
PyYAML==6.0.1
4+
ruamel.yaml==0.18.5

examples/training_container/train.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def parse_args():
8383
"--incremental",
8484
type=bool,
8585
default=True,
86+
action=argparse.BooleanOptionalAction,
8687
help="Send previous commit to download only the diff",
8788
)
8889
return parser.parse_args()
@@ -191,6 +192,7 @@ def run_experiment(client, configfile, code_path, model, incremental):
191192
version = None
192193
if incremental:
193194
version = model.get_version()
195+
print("Incremental Training enabled")
194196

195197
if version is None:
196198
print("Creating a new experiment on DeterminedAI...")
@@ -207,7 +209,7 @@ def run_experiment(client, configfile, code_path, model, incremental):
207209

208210
def get_checkpoint(exp):
209211
try:
210-
return exp.top_checkpoint()
212+
return exp.list_checkpoints(max_results=1)[0]
211213
except AssertionError:
212214
return None
213215

@@ -216,11 +218,11 @@ def get_checkpoint(exp):
216218

217219

218220
def get_or_create_model(client, model_name, pipeline, repo):
219-
models = client.get_models(name=model_name)
221+
models = client.list_models(name=model_name)
220222

221223
if len(models) > 0:
222224
print(f"Model already present. Updating it : {model_name}")
223-
model = client.get_models(name=model_name)[0]
225+
model = client.list_models(name=model_name)[0]
224226
else:
225227
print(f"Creating a new model : {model_name}")
226228
model = client.create_model(
@@ -277,7 +279,6 @@ def main():
277279
print(
278280
f"Starting pipeline: name='{pipeline}', repo='{args.repo}', job_id='{job_id}'"
279281
)
280-
281282
# --- Download code repository
282283

283284
local_repo = os.path.join(os.getcwd(), "code-repository")

0 commit comments

Comments
 (0)