GithubHelp home page GithubHelp logo

prune_opt's Introduction

Prune opt model

Prune the pre-trained opt-125m to 0.1 sparsity using global magnitude pruning, then fine-tune the pruned model

for model in 125m
do
    for sparsity in  0.1
    do
    python  run_clm_no_trainer_sparse.py \
        --freeze_weights \
        --noembed \
        --dataset_name wikitext \
        --dataset_config_name wikitext-103-raw-v1 \
        --model_name_or_path facebook/opt-$model \
        --output_dir ./tmp/test \
        --sparse_init  one_shot_gm  \
        --sparsity $sparsity 
    done
done

LMC on roberta-large model

indicate the checkpoint paths of two models using sparse_path and dense_path


sparse_path= sparse_path
dense_path=  dense_path


for seed in 41
do
  for TASK_NAME in qnli  
  do 
    for sparse_path in sparse_path
    do
      for validation_split_percentage in 100
      do
      python LMC.py \
        --noembed \
        --sparse_path $sparse_path \
        --dense_path $dense_path \
        --sparsity $sparsity \
        --model_name_or_path roberta-large \
        --task_name $TASK_NAME \
        --max_length 512 \
        --per_device_train_batch_size 16 \
        --learning_rate 2e-5 \
        --num_train_epochs 3 \
        --seed $seed 
      done
    done
  done
done






prune_opt's People

Contributors

luuyin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.