Registry / Framework

framework · v0.1.1
Flightdeck error-feedback
Compress a gradient to one sign and one row scale and carry the untransmitted residual to the next step.
Use Flightdeck error-feedback
use vendor::fd_error_feedback::error_feedback;
Run the example
nest demo fd_error_feedback@0.1.1
blyxc native-run fd_error_feedback-demo/main.blyx
Example source and expected output
use vendor::fd_error_feedback::error_feedback;
fn main() { fd_error_feedback(2, 7); }
Expected output
module {
func.func @main(%grad: tensor<2x7xf32>, %residual: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>) {
%v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
%v1 = stablehlo.add %grad, %residual : tensor<2x7xf32>
%v2 = stablehlo.abs %v1 : tensor<2x7xf32>
%v3 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<f32>
%v4 = stablehlo.reduce(%v2 init: %v3) applies stablehlo.add across dimensions = [1] : (tensor<2x7xf32>, tensor<f32>) -> tensor<2xf32>
%v5 = stablehlo.broadcast_in_dim %v4, dims = [0] : (tensor<2xf32>) -> tensor<2x7xf32>
%v6 = stablehlo.constant dense<7.0> : tensor<2x7xf32>
%v7 = stablehlo.divide %v5, %v6 : tensor<2x7xf32>
%v8 = stablehlo.sign %v1 : tensor<2x7xf32>
%v9 = stablehlo.multiply %v7, %v8 : tensor<2x7xf32>
%v10 = stablehlo.subtract %v1, %v9 : tensor<2x7xf32>
return %v9, %v10, %v7 : tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>
}
}
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.1 | Download ZIP · Browse files | bf9c3d5003 | 7e1fed5974c718e171dd56258dcc68ede065e34f0f321a00058e0fa62b8cc94b |
| 0.1.0 | Download ZIP · Browse files | d5835c5109 | 1c7d2d0d36a12bb5051f759d3494a5a586311078ce89384d349751ad09b7b08c |