Skip to content

Conversation

liqiangxl
Copy link
Collaborator

Prefer to avoid illegal input cache instead of revertUseOfInputCache,

@liqiangxl
Copy link
Collaborator Author

!test

Copy link

Description

  • Remove redundant input cache promotion logic

  • Avoid illegal caching of global memory inputs

  • Simplify memory type promotion workflow

  • Fix potential invalid IR graph construction


Changes walkthrough 📝

Relevant files
Bug fix
utils.cpp
Remove input cache reversion logic                                             

csrc/scheduler/utils.cpp

  • Remove revertUseOfInputCache function that handled input cache
    reversion
  • Eliminate check for input cache promotion to global memory
  • Simplify promoteProducerMemoryTypes by removing special case handling
  • Prevent invalid caching of global memory inputs by design
  • +0/-65   

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🧪 No relevant tests
    ⚡ Recommended focus areas for review

    Possible Issue

    The removal of revertUseOfInputCache may lead to unnecessary global memory caching of input tensors, which could degrade performance. The new code no longer checks for input caches being promoted to global memory, potentially resulting in redundant memory operations.

        if (it == tvs_to_promote.end() || it->second == producer->getMemoryType()) {
          continue;
        }
    
        // Required memory type of the producer
        const auto new_mem_type = it->second;
        producer->setMemoryType(new_mem_type);
      }
    }

    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