-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently only has one parameter. Also added some minor tweaks. - Previously gridDim.x was static, which is now symbolic. - Rejects transpose-like patterns for now as they would need scheduling like what the transpose does.
- Loading branch information
Showing
2 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// clang-format off | ||
/* | ||
* SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
// clang-format on | ||
#pragma once | ||
|
||
#include <c10/util/hash.h> | ||
#include <ir/interface_nodes.h> | ||
#include <scheduler/heuristic.h> | ||
#include <utils.h> | ||
|
||
#include <sstream> | ||
|
||
namespace nvfuser { | ||
|
||
class ResizeParams : public HeuristicParams { | ||
public: | ||
ResizeParams() : HeuristicParams(SchedulerType::Resize) {}; | ||
|
||
// Split grid x dimension | ||
bool split_grid_x_dim = false; | ||
|
||
static constexpr int64_t max_gdimx = (1L << 31) - 1L; | ||
|
||
using HeuristicParams::HeuristicParams; | ||
|
||
// Warning: Does not check launch parameters! | ||
bool sameAs(const HeuristicParams* other_base) const override { | ||
auto other = dynamic_cast<const ResizeParams*>(other_base); | ||
if (other == nullptr) { | ||
return false; | ||
} | ||
bool attr_equal = other->cparams == cparams && | ||
other->split_grid_x_dim == split_grid_x_dim; | ||
return attr_equal; | ||
} | ||
|
||
std::string toString() const override { | ||
std::stringstream ss; | ||
ss << "\n===== Resize Parameters ========\n" | ||
<< (tag.empty() ? "" : "Tag: ") << tag << " Resize Characteristics:\n" | ||
<< " split grid x dim: " << split_grid_x_dim << "\n"; | ||
ss << "====================================\n"; | ||
return ss.str(); | ||
} | ||
|
||
size_t hash() const override { | ||
return c10::get_hash(split_grid_x_dim); | ||
} | ||
|
||
std::unique_ptr<HeuristicParams> clone() const override { | ||
return std::make_unique<ResizeParams>(*this); | ||
} | ||
}; | ||
|
||
} // namespace nvfuser |