Skip to content

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.

// Selected data types according to weight data type
template <typename WeiT>
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.

@@ -1,45 +1,31 @@
#pragma once

#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
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.

3 participants