Skip to content

Commit

Permalink
Extend DML max-length fix to other hardware (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatriceVignola committed Apr 23, 2024
1 parent 2b9b666 commit 54fe3fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ std::unique_ptr<Search> CreateSearch(const GeneratorParams& params) {

Generator::Generator(const Model& model, const GeneratorParams& params) : model_{model.shared_from_this()} {
#if USE_DML
// Temporary fix to work around overflows for caches that are multiples of 4 on Intel hardware in DirectML
if (model.device_type_ == DeviceType::DML && model.IsIntelDevice() && params.search.max_length % 4 == 0) {
// Temporary fix to work around overflows for caches that are multiples of 4 in DirectML
if (model.device_type_ == DeviceType::DML && params.search.max_length % 4 == 0) {
if (params.search.max_length == model.config_->model.context_length) {
--const_cast<GeneratorParams&>(params).search.max_length;
} else {
Expand Down

0 comments on commit 54fe3fd

Please sign in to comment.