{"id":13604129,"url":"https://github.com/MachineLearningSystem/23MLSYS-pipe-fisher","last_synced_at":"2025-04-11T23:31:46.668Z","repository":{"id":185461589,"uuid":"650457285","full_name":"MachineLearningSystem/23MLSYS-pipe-fisher","owner":"MachineLearningSystem","description":null,"archived":false,"fork":true,"pushed_at":"2023-04-29T15:20:48.000Z","size":475,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-07T08:42:09.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kazukiosawa/pipe-fisher","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MachineLearningSystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-07T05:42:57.000Z","updated_at":"2023-06-07T05:42:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MachineLearningSystem/23MLSYS-pipe-fisher","commit_stats":null,"previous_names":["machinelearningsystem/23mlsys-pipe-fisher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2F23MLSYS-pipe-fisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2F23MLSYS-pipe-fisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2F23MLSYS-pipe-fisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2F23MLSYS-pipe-fisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MachineLearningSystem","download_url":"https://codeload.github.com/MachineLearningSystem/23MLSYS-pipe-fisher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248494996,"owners_count":21113544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:00:40.349Z","updated_at":"2025-04-11T23:31:46.266Z","avatar_url":"https://github.com/MachineLearningSystem.png","language":null,"funding_links":[],"categories":["Paper-Code"],"sub_categories":["Parallellism Training"],"readme":"# PipeFisher\r\n\r\nThe implementation of pipeline-parallel training with K-FAC optimizer (PipeFisher) in PyTorch used in [PipeFisher: Efficient Training of Large Language Models Using Pipelining and Fisher Information Matrices](https://arxiv.org/abs/2211.14133) (to appear at MLSys 2023).\r\n\r\n## Setup\r\n\r\n### Data preparation\r\nhttps://github.com/microsoft/AzureML-BERT/blob/master/docs/dataprep.md\r\n\r\nPlease store `wikipedia.segmented.nltk.txt` file under the `bert_data/` directory.\r\n\r\n### Installation\r\n```\r\npip install -r requirements.txt\r\npip install asdfghjkl/\r\n```\r\nFor training, we use `apex.optimizers.FusedLAMB` of [NVIDIA's Apex library](https://github.com/NVIDIA/apex). Please follow the [instruction](https://github.com/NVIDIA/apex#installation) for installing `apex`. \r\n\r\nFor profiling, we use [NVIDIA Nsight Systems](https://developer.nvidia.com/nsight-systems). Please make sure you can execute `nsys` command.\r\n\r\nOur scripts are intended to run through the SLURM workload manager on a GPU cluster with 1 GPU per node.\r\n\r\n## Training\r\n\r\nPhase 1 pretraining of BERT-Base on the English Wikipedia by NVLAMB on 32 GPUs\r\n```\r\nsbatch scripts/train.sh\r\n```\r\n\r\nPhase 1 pretraining of BERT-Base on the English Wikipedia by K-FAC on 32 GPUs\r\n```\r\nsbatch scripts/train_kfac.sh\r\n```\r\n\r\n\u003cimg width=\"677\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7961228/170479576-ce39e926-7bf3-4f11-8918-145278596917.png\"\u003e\r\n\r\n\r\n## Profiling\r\n\r\n### Step 0. Profiling **Chimera** with 8 stages for BERT-Large on 8 GPUs \r\n```\r\nsbatch scripts/prof_steps.sh\r\n```\r\n```\r\nsh scripts/plot_cuda_timeline.sh\r\n```\r\noutput: `bert_prof/bert-large_chimera_8stages_8gpus_microbs32_acc1.pdf`\r\n\r\n### Step 1. Profiling **Chimera with K-FAC** with 8 stages for BERT-Large on 8 GPUs \r\n```\r\nsbatch scripts/prof_kfac_steps.sh\r\n```\r\n```\r\nsh scripts/plot_cuda_timeline_kfac.sh\r\n```\r\noutput: `bert_prof/bert-large_chimera_8stages_8gpus_microbs32_acc1_kfac.pdf`\r\n\r\n### Step 2. Automatic work assignments\r\n```\r\nsh scripts/auto_schedule.sh\r\n```\r\noutput: `bert-large_chimera_8stages_8gpus_microbs32_acc1_kfac_schedule.pickle`\r\n\r\n### Step 3. Profiling **Chimera with PipeFisher** with 8 stages for BERT-Large on 8 GPUs \r\n```\r\nsbatch scripts/prof_pipefisher_steps.sh\r\n```\r\n```\r\nsh scripts/plot_cuda_timeline_pipefisher.sh\r\n```\r\noutput: `bert_prof/bert-large_chimera_8stages_8gpus_microbs32_acc1_pipefisher.pdf`\r\n\r\n\u003cimg width=\"849\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7961228/170479526-c13310e3-c644-4725-bb2a-5ef0829a1395.png\"\u003e\r\n\r\n\r\nBy changing the settings of each script, you can run training/profiling on other BERT models, pipeline methods, number of pipeline stages, number of GPUs, etc.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2F23MLSYS-pipe-fisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMachineLearningSystem%2F23MLSYS-pipe-fisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2F23MLSYS-pipe-fisher/lists"}