[nativert] move executor config to torch (#153087)

Summary:
nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md

To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed.

This diff moves the executor config to torch. since it's header-only this requires some changes to the libtorch build configs

Test Plan: CI

Differential Revision: D74278789

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153087
Approved by: https://github.com/zhxchen17
This commit is contained in:
dolpm
2025-05-13 23:25:57 +00:00
committed by PyTorch MergeBot
parent 3498201e57
commit 40b719c97d

View File

@ -0,0 +1,21 @@
#pragma once
#include <cstdint>
#include <string>
namespace torch::nativert {
struct ExecutorConfig {
bool validateInputs = false;
bool debugNan = false;
bool enableStaticCPUKernels = false;
bool enableStaticMemoryPlanning = false;
bool runConstFolding = false;
// allows up to max number of concurrent threads.
int64_t maxNumConcurrentThreads = 8;
// allows up to max number of parallel ops.
int64_t maxParallelOps = 1;
std::string modelName = "unknown";
};
} // namespace torch::nativert