Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Layer] Fine grained data type definition for Attention and MLP #194

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

pujiang2018
Copy link
Contributor

Main modification:

  • Make xFT support any data type for input, output and intermediate buffer, by adding more template parameters to Attention and MLP.
  • Llama model data type definition according to type selector
  • more data type support for some utility functions
  • BF16 communication
  • Some little refactor (like in CommonDecoder)

(Please be noted, this PR targets to make the pure BF16 flow works, the performance is not optimized yet)

@pujiang2018 pujiang2018 requested a review from changqi1 January 23, 2024 06:41
@@ -0,0 +1,162 @@
#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.

Add License.

#include "amx_sgemm_bf16bf16bf16.h"
#include "bfloat16.h"
#include "copy_util.h"
#include "attention_kernels.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add License.

@@ -0,0 +1,67 @@
#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.

Add License.

@@ -7,13 +7,15 @@ struct TypeSelector {
using InType = float;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add License.

@@ -3,43 +3,29 @@
#include <cstdio>
Copy link
Contributor

Choose a reason for hiding this comment

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

Add License.

@changqi1 changqi1 changed the title Fine grained data type definition for Attention and MLP [Layer] Fine grained data type definition for Attention and MLP Jan 27, 2024
@changqi1
Copy link
Contributor

@pujiang2018

@pujiang2018
Copy link
Contributor Author

added the license header.

@changqi1
Copy link
Contributor

@pujiang2018 Have a conflict.

@changqi1 changqi1 merged commit 08527aa into main Jan 30, 2024
1 check passed
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