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

Driver quantize fp8 update #3715

Open
wants to merge 6 commits into
base: ocp_to_fnuz
Choose a base branch
from
Open
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
23 changes: 2 additions & 21 deletions src/quantization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@
}

run_passes(prog,
{quantize_8bits_pass{precision, *quant_8bit_params},
simplify_qdq{},
optimize_module{},
dead_code_elimination{}},
{quantize_8bits_pass{precision, *quant_8bit_params}, dead_code_elimination{}},
quant_tracer());
}

Expand Down Expand Up @@ -198,23 +195,7 @@
supported_ins_names.insert(ins->name());
}
}
auto gfx_has_fp8fnuz = [&]() {
if(t.name() == "gpu")
{
auto context_value = t.get_context().to_value();
auto device_name = context_value["gfx_name"].to<std::string>();
return (starts_with(device_name, "gfx9") and device_name >= "gfx940");
}
return false;
};
if(gfx_has_fp8fnuz())
{
quantize_8bits(prog, t, shape::fp8e4m3fnuz_type, calibration, supported_ins_names);
}
else
{
quantize_8bits(prog, t, shape::fp8e4m3fn_type, calibration, supported_ins_names);
}
quantize_8bits(prog, t, shape::fp8e4m3fn_type, calibration, supported_ins_names);

Check warning on line 198 in src/quantization.cpp

View check run for this annotation

Codecov / codecov/patch

src/quantization.cpp#L198

Added line #L198 was not covered by tests
}
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx
1 change: 0 additions & 1 deletion src/targets/gpu/include/migraphx/gpu/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ struct context
value result;
result["events"] = events.size();
result["streams"] = current_device->nstreams();
result["gfx_name"] = get_current_device().get_gfx_name();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this removed on serialization?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this earlier when getting FP8 OCP in to query the gfx number from the driver. We could keep it, but it would not be used anywhere anymore.


return result;
}
Expand Down
3 changes: 0 additions & 3 deletions test/gpu/context_serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ TEST_CASE(gpu_context_serialize)
EXPECT(v.contains("streams"));
EXPECT(v.at("streams").without_key().to<std::size_t>() == 3);

EXPECT(v.contains("gfx_name"));
EXPECT(not v.at("gfx_name").without_key().to<std::string>().empty());

migraphx::gpu::context g_ctx;
g_ctx.from_value(v);

Expand Down
Loading