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

- Add abstract func for HFP8QuantizedToFloat #3000

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fbgemm_gpu/fbgemm_gpu/sparse_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,10 @@ def float_to_hfp8_quantized(
return torch.empty_like(input, dtype=torch.uint8)


def hfp8_quantized_to_float(input: Tensor, ebits: int, exponent_bias: int) -> Tensor:
return torch.empty_like(input, dtype=torch.float32)


def _setup() -> None:
# pyre-ignore[16]
_setup.done = getattr(_setup, "done", False)
Expand Down Expand Up @@ -1102,6 +1106,11 @@ def impl_autograd(op_name, fn, setup_context: Optional[Callable] = None) -> None
"fbgemm::FloatToHFP8Quantized",
float_to_hfp8_quantized,
)
impl_abstract(
"fbgemm::HFP8QuantizedToFloat",
hfp8_quantized_to_float,
)

_setup.done = True


Expand Down
15 changes: 1 addition & 14 deletions fbgemm_gpu/test/quantize/failures_dict_fast.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@
"status": "xfail"
}
},
"fbgemm::HFP8QuantizedToFloat": {
"SplitTableBatchedEmbeddingsTest.test_faketensor__test_nbit_forward_cpu": {
"comment": "",
"status": "xfail"
},
"SplitTableBatchedEmbeddingsTest.test_faketensor__test_nbit_forward_gpu_no_cache": {
"comment": "",
"status": "xfail"
},
"SplitTableBatchedEmbeddingsTest.test_faketensor__test_nbit_forward_gpu_no_cache_fp8_2048": {
"comment": "",
"status": "xfail"
}
}
"fbgemm::HFP8QuantizedToFloat": {}
}
}
Loading