f2010126/FinalThesis

Upload Again Attempt

0

stars

6

commits

Python

primary language

Aug 12, 2024

updated

README

FinalThesis_12Aug

Upload Again Attempt

File Structure

Schema

Adapters

Code for Using PEFT type as part of the framework

Cleaned Datasets

Core Datasets in format of sentence and label for easier processing. Raw datasets are available via Huggingface.

HPO

Ray Cluster Test

MetaDataCreation

Relevant to training the surrogate. Contains code to make the performance matrix, training data, train, optimise and predict with the model.

RayCode

Test stuff for Ray, trying the library and available optimisers of Ray Tune.

BoHBCode

HPO:

Adjust bohb_ray_slurm_template.sh as needed and execute it. It starts a RayCluster before starting the BoHB runner. The BoHB runner, bohb_runner.py starts multiple processes for HPO and results are stored. There is no Multiprocessing clash due to Ray having a separate environment. Parameter space is defined in bohb_ray_cluster.py

Search Space

NameTypeRange/Value
max seq lengthcategorical128, 256, 512
train batch sizecategorical4, 8, 16
model namecategoricalBert base uncased, Bert base multilingual cased
Bert base german cased oldvocab,gottbert base
TinyBERT General 4L de, Alberti bert base multilingual cased
Distilbert base german cased
optimizercategoricalAdam, AdamW, SGD , RAdam
learning ratefloat[2e-5 7e-5] log
schedulercategoricallinear with warmup , cosine with warmup
cosine with hard restarts with warmup, polynomial decay with warmup
weight decaycategorical[1e-5, 1e-3] log
warmup stepscategorical10, 100, 500
gradient accumulation stepscategorical1, 4, 8, 16
adam epsilonfloat[1e-8, 1e-6] log

Surrogate Training

Run create_training_data.py to make the cost matrix, create_training_data.py to make. the training data for the model.

The files to train (metamodel_train.py) and optimise the model (metamodel_train.py) are provided. metamodel_predict.py is used to test.

Final_perfmatrix_

TinyBERT

Code for distillation of TinyBERT. Consists of 2 stage distillation:

General for the Embedded layers

genDistill_

Finetuning for the predicted layers.

taskDistill_

Workflow

  • Run the search for the incubent pipelines using bohb_ray_slurm_template.sh
  • Create the performance matrix based on the results
  • Create the Training data using create_training_data.py
  • Train, optimise and predict using metamodel_train.py, metamodel_train.py and metamodel_predict.py.

Extension for new Datasets

  • Add the dataset processing to data_modules.py.

Extension for new Pipeline options

  • Add the changes to the parameter space in bohb_ray_cluster.py

Contributors

f2010126

6 commits

f2010126/FinalThesis

Upload Again Attempt

0

stars

6

commits

Python

primary language

Aug 12, 2024

updated

README

FinalThesis_12Aug

Upload Again Attempt

File Structure

Schema

Adapters

Code for Using PEFT type as part of the framework

Cleaned Datasets

Core Datasets in format of sentence and label for easier processing. Raw datasets are available via Huggingface.

HPO

Ray Cluster Test

MetaDataCreation

Relevant to training the surrogate. Contains code to make the performance matrix, training data, train, optimise and predict with the model.

RayCode

Test stuff for Ray, trying the library and available optimisers of Ray Tune.

BoHBCode

HPO:

Adjust bohb_ray_slurm_template.sh as needed and execute it. It starts a RayCluster before starting the BoHB runner. The BoHB runner, bohb_runner.py starts multiple processes for HPO and results are stored. There is no Multiprocessing clash due to Ray having a separate environment. Parameter space is defined in bohb_ray_cluster.py

Search Space

NameTypeRange/Value
max seq lengthcategorical128, 256, 512
train batch sizecategorical4, 8, 16
model namecategoricalBert base uncased, Bert base multilingual cased
Bert base german cased oldvocab,gottbert base
TinyBERT General 4L de, Alberti bert base multilingual cased
Distilbert base german cased
optimizercategoricalAdam, AdamW, SGD , RAdam
learning ratefloat[2e-5 7e-5] log
schedulercategoricallinear with warmup , cosine with warmup
cosine with hard restarts with warmup, polynomial decay with warmup
weight decaycategorical[1e-5, 1e-3] log
warmup stepscategorical10, 100, 500
gradient accumulation stepscategorical1, 4, 8, 16
adam epsilonfloat[1e-8, 1e-6] log

Surrogate Training

Run create_training_data.py to make the cost matrix, create_training_data.py to make. the training data for the model.

The files to train (metamodel_train.py) and optimise the model (metamodel_train.py) are provided. metamodel_predict.py is used to test.

Final_perfmatrix_

TinyBERT

Code for distillation of TinyBERT. Consists of 2 stage distillation:

General for the Embedded layers

genDistill_

Finetuning for the predicted layers.

taskDistill_

Workflow

  • Run the search for the incubent pipelines using bohb_ray_slurm_template.sh
  • Create the performance matrix based on the results
  • Create the Training data using create_training_data.py
  • Train, optimise and predict using metamodel_train.py, metamodel_train.py and metamodel_predict.py.

Extension for new Datasets

  • Add the dataset processing to data_modules.py.

Extension for new Pipeline options

  • Add the changes to the parameter space in bohb_ray_cluster.py

Contributors

f2010126

6 commits

Languages

Python

96.3%

Shell

3.7%