tuning

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNumProcesses = "1"
	DefaultNumMachines  = "1"
	DefaultMachineRank  = "0"
	DefaultGPUIds       = "all"
)
View Source
const (
	Port5000                = int32(5000)
	TuningFile              = "fine_tuning.py"
	DefaultBaseDir          = "/mnt"
	DefaultOutputVolumePath = "/mnt/output"
)

Variables

View Source
var (
	DefaultAccelerateParams = map[string]string{
		"num_processes": DefaultNumProcesses,
		"num_machines":  DefaultNumMachines,
		"machine_rank":  DefaultMachineRank,
		"gpu_ids":       DefaultGPUIds,
	}

	DefaultImagePullSecrets = []corev1.LocalObjectReference{}
)

Functions

func CreatePresetTuning

func CreatePresetTuning(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, revisionNum string,
	tuningObj *model.PresetParam, kubeClient client.Client) (client.Object, error)

func EnsureTuningConfigMap

func EnsureTuningConfigMap(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace,
	kubeClient client.Client) (*corev1.ConfigMap, error)

EnsureTuningConfigMap handles two scenarios: 1. Custom config template specified:

  • Check if it exists in the target namespace.
  • If not, check the release namespace and copy it to the target namespace if found.

2. No custom config template specified:

  • Use the default config template based on the tuning method (e.g., LoRA or QLoRA).
  • Check if it exists in the target namespace.
  • If not, check the release namespace and copy it to the target namespace if found.

func GetOutputDirFromTrainingArgs

func GetOutputDirFromTrainingArgs(trainingArgs map[string]runtime.RawExtension) (string, *apis.FieldError)

GetOutputDirFromTrainingArgs retrieves the output directory from training arguments if specified.

func GetTrainingOutputDir

func GetTrainingOutputDir(ctx context.Context, configMap *corev1.ConfigMap) (string, error)

GetTrainingOutputDir retrieves and validates the output directory from the ConfigMap.

func GetTuningImageInfo

func GetTuningImageInfo(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, presetObj *model.PresetParam) (string, []corev1.LocalObjectReference)

func PrepareOutputDir

func PrepareOutputDir(outputDir string) (string, error)

PrepareOutputDir ensures the output directory is within the base directory.

func SetupTrainingOutputVolume

func SetupTrainingOutputVolume(ctx context.Context, configMap *corev1.ConfigMap) (corev1.Volume, corev1.VolumeMount, string)

SetupTrainingOutputVolume adds shared volume for results dir

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL