Skip to content

Refactor codegen to separate GPU/CPU code generation#176

Merged
yaoyaoding merged 9 commits intohidet-org:mainfrom
LDY1998:jerry-cpu-3
Apr 21, 2023
Merged

Refactor codegen to separate GPU/CPU code generation#176
yaoyaoding merged 9 commits intohidet-org:mainfrom
LDY1998:jerry-cpu-3

Conversation

@LDY1998
Copy link
Copy Markdown
Contributor

@LDY1998 LDY1998 commented Apr 15, 2023

This is an attempt to refactor codegen.py to separate code generation for GPU and CPU, it also adds emulation for fp16 and bfloat16 as cpu has no native support for them. I didn't change the workflow of compilation yet since we only want to run CPU codegen of hidet in an environment without CUDA support, this means that all the dependencies of cudart should not run when GPU is not available.

Tasks:

  • Refactor codegen
  • Add fp16 and bf16 emulation

Tasks to be done:

  • [] Separate dependencies of cudart
  • [] Change to compilation workflow to run CPUCodegen when GPU is not available

@yaoyaoding
Copy link
Copy Markdown
Member

Hi @LDY1998,

Thanks for the PR! Please let us know when you think this PR is ready for review.

Copy link
Copy Markdown
Member

@yaoyaoding yaoyaoding left a comment

Choose a reason for hiding this comment

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

Hi @LDY1998, the PR looks good in general. I left some minor comments. Because it does not influence the existing cuda implementation, after you fixing these comments, we can merge it to the main branch.

@yaoyaoding
Copy link
Copy Markdown
Member

You can also create an issue to track the support for CPU backend.

@yaoyaoding yaoyaoding merged commit f361211 into hidet-org:main Apr 21, 2023
@yaoyaoding
Copy link
Copy Markdown
Member

Thanks @LDY1998!

AndreSlavescu pushed a commit to AndreSlavescu/hidet that referenced this pull request Apr 25, 2023
…-org#176)

* refactor codegen to separate cpu and gpu backend

* add float16 and bfloat16 headers

* register bfloat16 primitive functions

* register fp16 primitive functions

* formatting

* modify codegen

* rename bfloat16 and float16 type

* fix rename

* fix comment
AndreSlavescu pushed a commit to AndreSlavescu/hidet that referenced this pull request Apr 25, 2023
…-org#176)

* refactor codegen to separate cpu and gpu backend

* add float16 and bfloat16 headers

* register bfloat16 primitive functions

* register fp16 primitive functions

* formatting

* modify codegen

* rename bfloat16 and float16 type

* fix rename

* fix comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants