Skip to content

Commit

Permalink
add components to output artifacts from final eval
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
  • Loading branch information
MichaelClifford committed Jan 17, 2025
1 parent 3d89fdf commit 6259904
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eval/final.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# type: ignore
# pylint: disable=import-outside-toplevel,import-error

from kfp.dsl import Artifact, Input, Metrics, Output, component
from kfp.dsl import Metrics, Output, component

from utils.consts import PYTHON_IMAGE, RHELAI_IMAGE

Expand Down
65 changes: 64 additions & 1 deletion pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,18 @@ components:
defaultValue: /model
isOptional: true
parameterType: STRING
comp-pvc-to-mmlu-branch-op:
executorLabel: exec-pvc-to-mmlu-branch-op
inputDefinitions:
parameters:
pvc_path:
parameterType: STRING
outputDefinitions:
artifacts:
mmlu_branch_output:
artifactType:
schemaTitle: system.Artifact
schemaVersion: 0.0.1
comp-pvc-to-model-op:
executorLabel: exec-pvc-to-model-op
inputDefinitions:
Expand All @@ -341,6 +353,18 @@ components:
artifactType:
schemaTitle: system.Model
schemaVersion: 0.0.1
comp-pvc-to-mt-bench-branch-op:
executorLabel: exec-pvc-to-mt-bench-branch-op
inputDefinitions:
parameters:
pvc_path:
parameterType: STRING
outputDefinitions:
artifacts:
mt_bench_branch_output:
artifactType:
schemaTitle: system.Artifact
schemaVersion: 0.0.1
comp-pvc-to-mt-bench-op:
executorLabel: exec-pvc-to-mt-bench-op
inputDefinitions:
Expand Down Expand Up @@ -1832,7 +1856,6 @@ root:
name: comp-generate-metrics-report-op
dependentTasks:
- createpvc-3
- pvc-to-mt-bench-op
- run-final-eval-op
taskInfo:
name: generate-metrics-report-op
Expand Down Expand Up @@ -1887,6 +1910,20 @@ root:
producerTask: importer
taskInfo:
name: model-to-pvc-op
pvc-to-mmlu-branch-op:
cachingOptions: {}
componentRef:
name: comp-pvc-to-mmlu-branch-op
dependentTasks:
- createpvc-3
- run-final-eval-op
inputs:
parameters:
pvc_path:
runtimeValue:
constant: /output/mmlu_branch/mmlu_branch_data.json
taskInfo:
name: pvc-to-mmlu-branch-op
pvc-to-model-op:
cachingOptions: {}
componentRef:
Expand All @@ -1901,6 +1938,20 @@ root:
constant: /output/phase_2/model/hf_format/candidate_model
taskInfo:
name: pvc-to-model-op
pvc-to-mt-bench-branch-op:
cachingOptions: {}
componentRef:
name: comp-pvc-to-mt-bench-branch-op
dependentTasks:
- createpvc-3
- run-final-eval-op
inputs:
parameters:
pvc_path:
runtimeValue:
constant: /output/mt_bench_branch/mt_bench_branch_data.json
taskInfo:
name: pvc-to-mt-bench-branch-op
pvc-to-mt-bench-op:
cachingOptions: {}
componentRef:
Expand Down Expand Up @@ -2335,12 +2386,24 @@ platforms:
taskOutputParameter:
outputParameterKey: name
producerTask: createpvc-2
exec-pvc-to-mmlu-branch-op:
pvcMount:
- mountPath: /output
taskOutputParameter:
outputParameterKey: name
producerTask: createpvc-3
exec-pvc-to-model-op:
pvcMount:
- mountPath: /output
taskOutputParameter:
outputParameterKey: name
producerTask: createpvc-3
exec-pvc-to-mt-bench-branch-op:
pvcMount:
- mountPath: /output
taskOutputParameter:
outputParameterKey: name
producerTask: createpvc-3
exec-pvc-to-mt-bench-op:
pvcMount:
- mountPath: /output
Expand Down
4 changes: 4 additions & 0 deletions utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
from .components import (
ilab_importer_op,
model_to_pvc_op,
pvc_to_mmlu_branch_op,
pvc_to_model_op,
pvc_to_mt_bench_branch_op,
pvc_to_mt_bench_op,
)

__all__ = [
"model_to_pvc_op",
"pvc_to_mt_bench_op",
"pvc_to_mt_bench_branch_op",
"pvc_to_mmlu_branch_op",
"pvc_to_model_op",
"ilab_importer_op",
]
20 changes: 20 additions & 0 deletions utils/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ def pvc_to_mt_bench_op(mt_bench_output: dsl.Output[dsl.Artifact], pvc_path: str)
)


@dsl.container_component
def pvc_to_mt_bench_branch_op(
mt_bench_branch_output: dsl.Output[dsl.Artifact], pvc_path: str
):
return dsl.ContainerSpec(
TOOLBOX_IMAGE,
["/bin/sh", "-c"],
[f"cp -r {pvc_path} {mt_bench_branch_output.path}"],
)


@dsl.container_component
def pvc_to_mmlu_branch_op(mmlu_branch_output: dsl.Output[dsl.Artifact], pvc_path: str):
return dsl.ContainerSpec(
TOOLBOX_IMAGE,
["/bin/sh", "-c"],
[f"cp -r {pvc_path} {mmlu_branch_output.path}"],
)


@dsl.container_component
def pvc_to_model_op(model: dsl.Output[dsl.Model], pvc_path: str):
return dsl.ContainerSpec(
Expand Down

0 comments on commit 6259904

Please sign in to comment.