GithubHelp home page GithubHelp logo

Comments (3)

cheshire avatar cheshire commented on June 30, 2024

@sergachev any thoughts?

from xla.

sergachev avatar sergachev commented on June 30, 2024

Sorry for the late reply.

I am verifying case by case in this model whether fusion merging decisions are well taken. Because the current approach optimizes only for the execution time and not the amount of memory allocation, sometimes the decisions to prevent fusion that make execution faster may lead to much larger temporary allocations. For instance, fusion.1594 from the bad example above writes 2.6 GB, but can potentially be merged with its consumers. We might need to add a way to trade performance for memory utilization. As a way to experiment with this I can propose to steer the model manually towards more fusion by multiplying the unfused time here https://github.com/openxla/xla/blob/main/xla/service/gpu/gpu_performance_model.cc#L210 by 1.1x ... 2x - this should give a smooth control over that performance <-> memory utilization balance.
It can also be that some of the fusion merging decisions are wrong, then improving the performance model will help.

from xla.

ymwangg avatar ymwangg commented on June 30, 2024

Thanks for the info, increasing the scale factor of time_unfused did decrease the memory usage.

  GpuPerformanceModel::RunTimes t = GpuPerformanceModel::EstimateRunTimes(
    producer, &*cost_analysis_, gpu_device_info_, producer->users(),
      /*multi_output=*/false);
  if (t.time_fused > scale*t.time_unfused) {
    ++num_fail_slower_if_fused_;
    return "will execute slower if fused";
  }
scale Total bytes used
1.0 54.55GiB
1.5 47.75GiB
2.0 34.37GiB
inf 34.04GiB

from xla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.