• Stars
    star
    1,415
  • Rank 33,251 (Top 0.7 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Repository for hyperparameter tuning

logo

Build Status Coverage Status Go Report Card Releases Slack Status

Katib is a Kubernetes-native project for automated machine learning (AutoML). Katib supports Hyperparameter Tuning, Early Stopping and Neural Architecture Search.

Katib is the project which is agnostic to machine learning (ML) frameworks. It can tune hyperparameters of applications written in any language of the usersโ€™ choice and natively supports many ML frameworks, such as TensorFlow, Apache MXNet, PyTorch, XGBoost, and others.

Katib can perform training jobs using any Kubernetes Custom Resources with out of the box support for Kubeflow Training Operator, Argo Workflows, Tekton Pipelines and many more.

Katib stands for secretary in Arabic.

Search Algorithms

Katib supports several search algorithms. Follow the Kubeflow documentation to know more about each algorithm and check the Suggestion service guide to implement your custom algorithm.

Hyperparameter Tuning Neural Architecture Search Early Stopping
Random Search ENAS Median Stop
Grid Search DARTS
Bayesian Optimization
TPE
Multivariate TPE
CMA-ES
Sobol's Quasirandom Sequence
HyperBand
Population Based Training

To perform above algorithms Katib supports the following frameworks:

Installation

For the various Katib installs check the Kubeflow guide. Follow the next steps to install Katib standalone.

Prerequisites

This is the minimal requirements to install Katib:

  • Kubernetes >= 1.23
  • kubectl >= 1.23

Latest Version

For the latest Katib version run this command:

kubectl apply -k "github.com/kubeflow/katib.git/manifests/v1beta1/installs/katib-standalone?ref=master"

Release Version

For the specific Katib release (for example v0.14.0) run this command:

kubectl apply -k "github.com/kubeflow/katib.git/manifests/v1beta1/installs/katib-standalone?ref=v0.14.0"

Make sure that all Katib components are running:

$ kubectl get pods -n kubeflow

NAME                                READY   STATUS      RESTARTS   AGE
katib-cert-generator-rw95w          0/1     Completed   0          35s
katib-controller-566595bdd8-hbxgf   1/1     Running     0          36s
katib-db-manager-57cd769cdb-4g99m   1/1     Running     0          36s
katib-mysql-7894994f88-5d4s5        1/1     Running     0          36s
katib-ui-5767cfccdc-pwg2x           1/1     Running     0          36s

For the Katib Experiments check the complete examples list.

Quickstart

You can run your first HyperParameter Tuning Experiment using Katib Python SDK.

In the following example we are going to maximize a simple objective function: $F(a,b) = 4a - b^2$. The bigger $a$ and the lesser $b$ value, the bigger the function value $F$.

import kubeflow.katib as katib

# Step 1. Create an objective function.
def objective(parameters):
    # Import required packages.
    import time
    time.sleep(5)
    # Calculate objective function.
    result = 4 * int(parameters["a"]) - float(parameters["b"]) ** 2
    # Katib parses metrics in this format: <metric-name>=<metric-value>.
    print(f"result={result}")

# Step 2. Create HyperParameter search space.
parameters = {
    "a": katib.search.int(min=10, max=20),
    "b": katib.search.double(min=0.1, max=0.2)
}

# Step 3. Create Katib Experiment.
katib_client = katib.KatibClient()
name = "tune-experiment"
katib_client.tune(
    name=name,
    objective=objective,
    parameters=parameters,
    objective_metric_name="result",
    max_trial_count=12
)

# Step 4. Get the best HyperParameters.
print(katib_client.get_optimal_hyperparameters(name))

Documentation

Community

We are always growing our community and invite new users and AutoML enthusiasts to contribute to the Katib project. The following links provide information about getting involved in the community:

Contributing

Please feel free to test the system! Developer guide is a good starting point for our developers.

Blog posts

Events

Citation

If you use Katib in a scientific publication, we would appreciate citations to the following paper:

A Scalable and Cloud-Native Hyperparameter Tuning System, George et al., arXiv:2006.02085, 2020.

Bibtex entry:

@misc{george2020katib,
    title={A Scalable and Cloud-Native Hyperparameter Tuning System},
    author={Johnu George and Ce Gao and Richard Liu and Hou Gang Liu and Yuan Tang and Ramdoot Pydipaty and Amit Kumar Saha},
    year={2020},
    eprint={2006.02085},
    archivePrefix={arXiv},
    primaryClass={cs.DC}
}

More Repositories

1

kubeflow

Machine Learning Toolkit for Kubernetes
TypeScript
13,574
star
2

pipelines

Machine Learning Pipelines for Kubeflow
Python
3,593
star
3

spark-operator

Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Go
2,765
star
4

training-operator

Distributed ML Training and Fine-Tuning on Kubernetes
Go
1,561
star
5

examples

A repository to host extended examples and tutorials
Jsonnet
1,400
star
6

manifests

A repository for Kustomize manifests
YAML
735
star
7

arena

A CLI for Kubeflow.
Go
730
star
8

mpi-operator

Kubernetes Operator for MPI-based applications (distributed training, HPC, etc.)
Go
392
star
9

fairing

Python SDK for building, training, and deploying ML models
Jsonnet
335
star
10

pytorch-operator

PyTorch on Kubernetes
Jsonnet
301
star
11

kfctl

kfctl is a CLI for deploying and managing Kubeflow
Go
177
star
12

example-seldon

Example for end-to-end machine learning on Kubernetes using Kubeflow and Seldon Core
Jupyter Notebook
172
star
13

kfp-tekton

Kubeflow Pipelines on Tekton
TypeScript
171
star
14

community

Information about the Kubeflow community including proposals and governance information.
Jsonnet
156
star
15

website

Kubeflow Website
HTML
148
star
16

metadata

Repository for assets related to Metadata.
TypeScript
120
star
17

xgboost-operator

Incubating project for xgboost operator
Python
76
star
18

kubebench

Repository for benchmarking
Jsonnet
75
star
19

testing

Test infrastructure and tooling for Kubeflow.
Python
63
star
20

code-intelligence

ML-Powered Developer Tools, using Kubeflow
Jupyter Notebook
56
star
21

mxnet-operator

A Kubernetes operator for mxnet jobs
Go
53
star
22

common

Common APIs and libraries shared by other Kubeflow operator repositories.
Go
51
star
23

fate-operator

Fate operator
Go
50
star
24

model-registry

Go
32
star
25

batch-predict

Repository for batch predict
Python
17
star
26

chainer-operator

Repository for chainer operator
Jsonnet
17
star
27

blog

Kubeflow blog based on fastpages
Jupyter Notebook
16
star
28

caffe2-operator

Experimental repository for a caffe2 operator
Go
16
star
29

internal-acls

Repository used to main group ACLs used by Kubeflow developers
Go
14
star
30

crd-validation

Validation Generation for Kubeflow CRD on Kubernetes
Go
11
star
31

kfserving-lts

Jsonnet
10
star
32

frontend

Repository for kubeflow frontend
JavaScript
8
star
33

kfp-tekton-backend

Experimental project plugging Tekton yaml behind KFP API and UI engine
TypeScript
8
star
34

marketing-materials

4
star
35

community-infra

Declarative configurations for KF community infrastructure
Go
3
star
36

fastpages

fastpages is a platform for blogging
Jupyter Notebook
3
star
37

.allstar

2
star
38

reporting

Repository for collecting and analyzing metrics about Kubeflow usage.
Jsonnet
2
star
39

.github

Org wide templates
2
star
40

dashboard

1
star