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

Int based RNG #3733

Draft
wants to merge 11 commits into
base: int_types
Choose a base branch
from
Draft

Int based RNG #3733

wants to merge 11 commits into from

Conversation

csarofeen
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Jan 19, 2025

PR Reviewer Guide 🔍

(Review updated until commit 2fa293d)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
⚡ Recommended focus areas for review

Logic Change

The condition in the if statement has been modified to also check if tv->getMemoryType() == MemoryType::Local. This change may affect the behavior of the function.

if (tv &&
    (aligned_array_of_regs_.count(tv) ||
     tv->getMemoryType() == MemoryType::Local)) {
New Functionality

A new function addRNG has been added, which appears to insert RNG (Random Number Generator) operations into the expression list. This new functionality may require additional testing and verification.

std::vector<Expr*> addRNG(const std::vector<Expr*>& exprs) {
  FUSER_PERF_SCOPE("GpuLower::Lower::addRNG");
  // Check if magic zero was even used, if not we don't have to define it or
  // update it.
  const auto gpu_lower = GpuLower::current();
  auto kernel = gpu_lower->kernel();
  const bool has_rng = std::any_of(
      kernel->exprs().begin(), kernel->exprs().end(), [](Expr* expr) {
        return expr->isA<RNGOp>();
      });

  if (!has_rng) {
    return exprs;
  }
  auto exprs_ = RNGInserter::insert(exprs);
  std::cout << "====================" << std::endl;
  for (auto expr : exprs_) {
    std::cout << expr->toString() << std::endl;
  }
  std::cout << "====================" << std::endl;
  // NVF_THROW("throw");
  return exprs_;
}
Enum Modification

A new value Philox has been added to the TernaryOpType enum. This change may affect the behavior of the program and requires verification.

enum class TernaryOpType { Clamp, Lerp, Threshold, Where, Philox };

@csarofeen csarofeen changed the base branch from main to int_types January 20, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant