Skip to content

Commit

Permalink
clean up copy and update learn more page
Browse files Browse the repository at this point in the history
Signed-off-by: Niels Bantilan <[email protected]>
  • Loading branch information
cosmicBboy committed Jan 7, 2025
1 parent 9e06527 commit 69dda9c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
12 changes: 6 additions & 6 deletions markdown/step_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies for our workflow. You can think of this as a high-level interface
to define a container image:

```python
image = fl.ImageSpec(packages=["pandas", "pyarrow", "scikit-learn"])
image = union.ImageSpec(packages=["pandas", "pyarrow", "scikit-learn"])
```

Then, we define the `get_data` and `train_model` tasks and compose them
Expand Down Expand Up @@ -56,19 +56,19 @@ def training_workflow(
```

Union supports seamless development from local to remote execution.
Run this workflow locally with the `union run` CLI command:
Run this workflow on the Workspace machine itself with the `union run` CLI command:

[▶️ Run locally in terminal](command:union-workspace.runTrainingLocal)
[▶️ Run locally in the Workspace](command:union-workspace.runTrainingLocal)

```bash
union run workflows/train.py training_workflow --max_iter 100
```

Note that you can pass arguments to the workflow as flags.
This is useful for quickly debugging your workflow in the local environment.

Then, to run this on Union Serverless, simply supply the `--remote` flag:
To run this on Union Serverless, simply supply the `--remote` flag:

[▶️ Run remotely in terminal](command:union-workspace.runTrainingRemote)
[▶️ Run remotely on the Union cluster](command:union-workspace.runTrainingRemote)


```bash
Expand Down
8 changes: 4 additions & 4 deletions markdown/step_02.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# 🔀 Parallelize Model Training

Union allows you to horizontally scale your workflows with `map_task`s. To
make this more concrete, we can define the hyperparameters of the model training
step as a dataclass and refactor the `train_model` task from the previous step:
Union horizontally scales your workflows with `map_task`s. To make this more
concrete, we can define the hyperparameters of the model training step as a
dataclass and refactor the `train_model` task from the previous step:

```python
from dataclasses import dataclass asdict
Expand Down Expand Up @@ -40,7 +40,7 @@ def training_workflow(hp_grid: list[Hyperparameters]) -> list[MLPClassifier]:

Run this workflow by passing a list of hyperparameters to the workflow:

[▶️ Run remotely in terminal](command:union-workspace.runParallelizeWorkflow)
[▶️ Run remotely on the Union cluster](command:union-workspace.runParallelizeWorkflow)

```bash
union run --remote workflows/parallelize.py training_workflow --hp_grid '[{"max_iter": 25}, {"max_iter": 500}, {"max_iter": 100}]'
Expand Down
26 changes: 26 additions & 0 deletions markdown/step_04.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,29 @@ You've successfully run your first Union workflows:
Use this workspace environment to learn more about Union by checking out the
[User Guide](https://docs.union.ai/serverless/user-guide/) and end-to-end
[Tutorial](https://docs.union.ai/serverless/tutorials/) examples.

Clone the Union examples repository to explore and run them:

```
git clone https://github.com/unionai/unionai-examples
cd unionai-examples
```

This repository contains `user_guide` and `tutorials` subfolders that correspond
to the [User Guide](https://docs.union.ai/serverless/user-guide/) and
[Tutorial](https://docs.union.ai/serverless/tutorials/) documentation, respectively.

For instance, to run the `user_guide` example [here](https://github.com/unionai/unionai-examples/blob/main/user_guide/first_workflow/ml_workflow/ml_workflow.py),
run the following command:

```
union run --remote user_guide/first_workflow/ml_workflow/ml_workflow.py main --max_bins 64
```

And to run the `tutorials` examples, simply run the instructions in the **Run on Union BYOC** dropdown.
For example, to train a [credit default model with XGBoost](https://docs.union.ai/byoc/tutorials/finance/credit-default-xgboost),
run the following command:

```
union run --remote tutorials/credit_default/credit_default.py credit_default_wf
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "union-workspace",
"displayName": "Union Workspace Onboarding",
"description": "Visual Studio Code onboarding experience for Union Workspaces",
"version": "0.0.10",
"version": "0.0.11",
"publisher": "unionai",
"engines": {
"vscode": "^1.71.0"
Expand Down

0 comments on commit 69dda9c

Please sign in to comment.