Skip to content

prune-bert-models

Automatically generated README for this automation recipe: prune-bert-models

Category: AI/ML optimization

License: Apache 2.0

  • Notes from the authors, contributors and users: README-extra

  • CM meta description for this script: _cm.json

  • Output cached? False

Reuse this script in your project

Install MLCommons CM automation meta-framework

Pull CM repository with this automation recipe (CM script)

cm pull repo mlcommons@cm4mlops

cmr "prune bert-models bert-prune prune-bert-models" --help

Run this script

Run this script via CLI
cm run script --tags=prune,bert-models,bert-prune,prune-bert-models[,variations] [--input_flags]
Run this script via CLI (alternative)
cmr "prune bert-models bert-prune prune-bert-models [variations]" [--input_flags]
Run this script from Python
import cmind

r = cmind.access({'action':'run'
              'automation':'script',
              'tags':'prune,bert-models,bert-prune,prune-bert-models'
              'out':'con',
              ...
              (other input keys for this script)
              ...
             })

if r['return']>0:
    print (r['error'])
Run this script via Docker (beta)
cm docker script "prune bert-models bert-prune prune-bert-models[variations]" [--input_flags]

Variations

  • No group (any combination of variations can be selected)

    Click here to expand this section.

    • _model.#
      • ENV variables:
        • CM_BERT_PRUNE_MODEL_NAME: #
        • CM_MODEL_ZOO_STUB: #
    • _path.#
      • ENV variables:
        • CM_BERT_PRUNE_CKPT_PATH: #
    • _task.#
      • ENV variables:
        • CM_BERT_PRUNE_TASK: #

Script flags mapped to environment

  • --constraint=valueCM_BERT_PRUNE_CONSTRAINT=value
  • --output_dir=valueCM_BERT_PRUNE_OUTPUT_DIR=value

Default environment

These keys can be updated via --env.KEY=VALUE or env dictionary in @input.json or using script flags.

  • CM_BERT_PRUNE_TASK: squad
  • CM_BERT_PRUNE_MODEL_NAME: bert-large-uncased
  • CM_MODEL_ZOO_STUB: bert-large-uncased
  • CM_BERT_PRUNE_CONSTRAINT: 0.5

Native script being run

No run file exists for Windows


Script output

cmr "prune bert-models bert-prune prune-bert-models [variations]" [--input_flags] -j