mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-11-04 16:04:58 +08:00 
			
		
		
		
	Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71662 backport v8 to v7 to support promoted ops as instruction a flag to help export as instruction from v8 and export as operators for v7 and below Test Plan: ``` buck test caffe2/test/cpp/jit:jit -- LiteInterpreterTest.BackPortByteCodeModelAllVersions Started reporting to test run: https://www.internalfb.com/intern/testinfra/testrun/5629499620570927 ✓ ListingSuccess: caffe2/test/cpp/jit:jit : 461 tests discovered (15.693) ✓ Pass: caffe2/test/cpp/jit:jit - LiteInterpreterTest.BackPortByteCodeModelAllVersions (2.712) Summary Pass: 1 ListingSuccess: 1 If you need help understanding your runs, please follow the wiki: https://fburl.com/posting_in_tpx_users Finished test run: https://www.internalfb.com/intern/testinfra/testrun/5629499620570927 ``` ``` buck run mode/opt //caffe2/torch/fb/mobile/upgrader_codegen:upgrader_codegen buck test mode/opt //caffe2/test:upgrader_codegen -- mobile.test_upgrader_codegen.TestLiteScriptModule Parsing buck files: finished in 0.8 sec Downloaded 0/2 artifacts, 0.00 bytes, 100.0% cache miss (for updated rules) Building: finished in 01:39.4 min (100%) 11031/11031 jobs, 2/11031 updated Total time: 01:40.2 min More details at https://www.internalfb.com/intern/buck/build/a8b0e417-019c-44ba-be6b-23379411a965 BUILD SUCCEEDED Tpx test run coordinator for Facebook. See https://fburl.com/tpx for details. Running with tpx session id: 44fbfa66-cce8-4277-82ac-f89d79558581 Trace available for this run at /tmp/tpx-20220202-160956.915412/trace.log RemoteExecution session id: reSessionID-44fbfa66-cce8-4277-82ac-f89d79558581-tpx Started reporting to test run: https://www.internalfb.com/intern/testinfra/testrun/281475200877601 ✓ ListingSuccess: caffe2/test:upgrader_codegen : 1 tests discovered (1.249) ✓ Pass: caffe2/test:upgrader_codegen - test_generate_bytecode (mobile.test_upgrader_codegen.TestLiteScriptModule) (1.365) Summary Pass: 1 ListingSuccess: 1 If you need help understanding your runs, please follow the wiki: https://fburl.com/posting_in_tpx_users Finished test run: https://www.internalfb.com/intern/testinfra/testrun/281475200877601 ``` Reviewed By: iseeyuan Differential Revision: D33719098 fbshipit-source-id: e2d2b23d298f98e4d4fcdfc344f7b8c6f92cff26 (cherry picked from commit 81b956c23abc19489b69eee986721252474d00dc)
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
#pragma once
 | 
						|
 | 
						|
#include <tuple>
 | 
						|
#include <unordered_map>
 | 
						|
 | 
						|
#include <ATen/core/function_schema.h>
 | 
						|
#include <ATen/core/ivalue.h>
 | 
						|
#include <ATen/core/jit_type.h>
 | 
						|
#include <ATen/core/qualified_name.h>
 | 
						|
#include <torch/csrc/jit/backends/backend_debug_handler.h>
 | 
						|
#include <torch/csrc/jit/mobile/function.h>
 | 
						|
#include <torch/csrc/jit/mobile/module.h>
 | 
						|
#include <torch/csrc/jit/runtime/interpreter.h>
 | 
						|
#include <torch/csrc/jit/serialization/type_name_uniquer.h>
 | 
						|
 | 
						|
namespace torch {
 | 
						|
namespace jit {
 | 
						|
 | 
						|
struct TORCH_API CompilationOptions {
 | 
						|
  bool incl_interface_call = false;
 | 
						|
  bool enable_default_value_for_unspecified_arg = false;
 | 
						|
  bool enable_default_args_before_out_args = true;
 | 
						|
  bool enable_emit_promoted_ops = true;
 | 
						|
  int model_version = caffe2::serialize::kProducedBytecodeVersion;
 | 
						|
};
 | 
						|
 | 
						|
TORCH_API mobile::Module jitModuleToMobile(
 | 
						|
    const Module& module,
 | 
						|
    const CompilationOptions& options);
 | 
						|
 | 
						|
mobile::Code compileGraphToMobileCode(
 | 
						|
    const std::string& name,
 | 
						|
    const std::shared_ptr<Graph>& graph,
 | 
						|
    const CompilationOptions& compilation_options,
 | 
						|
    BackendDebugInfoRecorder& debug_info_recorder);
 | 
						|
 | 
						|
TORCH_API std::unique_ptr<mobile::Function> convertJitFunctionToMobileFunction(
 | 
						|
    const GraphFunction& function,
 | 
						|
    const CompilationOptions& options);
 | 
						|
 | 
						|
TORCH_API IValue convertMobileFunctionToCodeTable(
 | 
						|
    const mobile::Function& func,
 | 
						|
    const CompilationOptions& compilation_options);
 | 
						|
 | 
						|
} // namespace jit
 | 
						|
} // namespace torch
 |