Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

FusedAdam & CPUAdam #120

Merged
merged 14 commits into from Jun 2, 2022
Merged

FusedAdam & CPUAdam #120

merged 14 commits into from Jun 2, 2022

Conversation

cozytk
Copy link
Collaborator

@cozytk cozytk commented May 31, 2022

Title

-FusedAdam & CPUAdam

Description

  • Implement FusedAdam & CPUAdam

Tasks

  • Implement FusedAdam
  • implement CPUAdam
  • Test FusedAdam
  • Test CPUAdam
  • Test FusedSclaeMaskSoftmax (Name changed)

@hyunwoongko
Copy link
Contributor

@cozytk Can we merge this now?

@cozytk
Copy link
Collaborator Author

cozytk commented Jun 1, 2022

@hyunwoongko Yes. It passes all tests and just few review points left

files

oslo/torch/_C/init.py

  • Tell Me if there is a code that you think unnecessary

oslo/torch/nn/parallel/data_parallel/sharded_data_parallel.py

  • Circular import occurs again and I temporarily commented out theUnion[ZeroRed...

oslo/torch/optim/cpu_adam.py

  • Need your opinion using class name like DeepSpeedCPUAdam

@hyunwoongko
Copy link
Contributor

  • Circular import occurs again and I temporarily commented out theUnion[ZeroRed...
    • remove this.
  • DeepSpeedCPUAdam -> CPUAdam

@cozytk
Copy link
Collaborator Author

cozytk commented Jun 2, 2022

@hyunwoongko Done!

@@ -0,0 +1,214 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need?

@@ -0,0 +1,36 @@
#pragma once
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need too?

#include "cublas_v2.h"
#include "cuda.h"
#include "curand.h"
#include "gemm_test.h"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyunwoongko çpu_adam.h requires context.h. context.h requires gemm_test.h

#pragma once

#include "StopWatch.h"
#include "cublas_wrappers.h"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyunwoongko gemm_test.h includes cublas_wrappers.h


void SetSeed(uint64_t new_seed) { _seed = new_seed; }

void TestGemmFP16(bool test_gemm, int batch_size, int seq_len, int head_num,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this. no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyunwoongko I'm gonna apply it!

@cozytk
Copy link
Collaborator Author

cozytk commented Jun 2, 2022

  • remove type annotating Union[ZeorRedu...]
  • changed named to CPUAdam
  • checked FusedAdam, CPUAdam tests work

@cozytk
Copy link
Collaborator Author

cozytk commented Jun 2, 2022

@hyunwoongko

  • remove func void TestGemmFP16
  • remove headers gems_test.h StopWatch.h cublas_wrappers.h
  • add include cuda_fp16.h in custom_cuda_layers.h

@hyunwoongko hyunwoongko merged commit 8cbc589 into master Jun 2, 2022
@cozytk cozytk deleted the fused_adam branch June 9, 2022 12:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants