Skip to main content

Parameter-Efficient Tuning

Project description

MindPet微调算法用户文档

一、MindPet简介

MindPet(Pet:Parameter-Efficient Tuning)是属于Mindspore领域的微调算法套件。随着计算算力不断增加,大模型无限的潜力也被挖掘出来。但随之在应用和训练上带来了巨大的花销,导致商业落地困难。因此,出现一种新的参数高效(parameter-efficient)算法,与标准的全参数微调相比,这些算法仅需要微调小部分参数,可以大大降低计算和存储成本,同时可媲美全参微调的性能。

二、环境准备

2.1 环境依赖

  • Python 3.7至3.9版本
  • MindSpore >= 1.8

2.2 软件安装

在代码仓根目录下运行以下命令,会生成dist文件夹以及whl包:

python set_up.py bdist_wheel

执行以下命令安装whl包:

pip install dist/mindpet-1.0.0-py3-none-any.whl

2.3 软件卸载

通过以下命令进行卸载:

pip uninstall mindpet

三、微调算法API

目前MindPet已提供以下五种经典低参微调算法以及一种提升精度的微调算法的API接口,用户可快速适配原始大模型,提升下游任务微调性能和精度;

微调算法 算法论文 使用说明
LoRA LoRA: Low-Rank Adaptation of Large Language Models TK_DeltaAlgorithm_README 第一章
PrefixTuning Prefix-Tuning: Optimizing Continuous Prompts for Generation TK_DeltaAlgorithm_README 第二章
Adapter Parameter-Efficient Transfer Learning for NLP TK_DeltaAlgorithm_README 第三章
LowRankAdapter Compacter: Efficient low-rank hypercom plex adapter layers TK_DeltaAlgorithm_README 第四章
BitFit BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-models TK_DeltaAlgorithm_README 第五章
R_Drop R-Drop: Regularized Dropout for Neural Networks TK_DeltaAlgorithm_README 第六章

四、共性图操作API

4.1 冻结指定模块功能API

MindPet支持用户根据 微调算法 或 模块名 冻结网络中部分模块,提供调用接口和配置文件两种实现方式。

使用说明参考TK_GraphOperation_README 第一章。

4.2 保存可训练参数功能API

MindPet支持用户单独保存训练中可更新的参数为ckpt文件,从而节省存储所用的物理资源。

使用说明参考TK_GraphOperation_README 第二章。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindpet-1.0.0.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

mindpet-1.0.0-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file mindpet-1.0.0.tar.gz.

File metadata

  • Download URL: mindpet-1.0.0.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for mindpet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a6bb68d139eba7bb0649c759ee23410aaa0b8d6b7f6264ff70e8a06a99cb771
MD5 1e3542a8b9ac2b92ee91557648363eb3
BLAKE2b-256 97790be69ada72d01c68c2a5f9f85b54bf6d5163982c95bda27e4bd550d1583f

See more details on using hashes here.

File details

Details for the file mindpet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mindpet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for mindpet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ddd6a58d584a0685b6b5bd043f8b94043004ff5d84e7b4209e4185b9e4e3713
MD5 5d2864a0ce406ceb7d875949794a273e
BLAKE2b-256 f18b624c0625d3d2488f859486b9adaa0d5c8d7910b608401f17a0a28d1a6ac7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page