Comments (8)
The use of tune_relax
can be something like
ms.relax_integration.tune_relax(
mod=mod_deploy,
target=tvm.target.Target("apple/m1-gpu-restricted"), # for WebGPU 256-thread limitation
params={},
builder=ms.builder.LocalBuilder(
max_workers=os.cpu_count(),
),
runner=ms.runner.LocalRunner(timeout_sec=60),
work_dir="log_db",
max_trials_global=50000,
max_trials_per_task=2000,
)
from web-stable-diffusion.
After finishing tuning, I use:
with args.target, db, tvm.transform.PassContext(opt_level=3):
mod_deploy = relax.transform.MetaScheduleApplyDatabase(enable_warning=True)(mod)
It will show many warnings like:
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: matmul23
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_conv2d14_add24_add25
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: take
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_conv2d37_add34_add35_divide7
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_conv2d24_add10
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_conv2d7_add10
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_matmul28_add27_add28
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_matmul11_add11_strided_slice4
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_conv2d4_add10_add12
[17:27:57] /home/wyc/husen/sandbox/tvm/src/relax/transform/meta_schedule.cc:162: Warning: Tuning record is not found for primfunc: fused_matmul9_add8_gelu
Then I use relax.build
, it will show the typical Did you forget to bind?
error.
I don't know why this happen.
from web-stable-diffusion.
You can use diffusers==0.15.0 version and problems may all be solved. ^^
from web-stable-diffusion.
You can use diffusers==0.15.0 version and problems may all be solved. ^^
Thanks for your help! But I've tried this, still not work.
from web-stable-diffusion.
Hi @Civitasv, thanks for the question! We used meta_schedule.relax_integration.tune_relax
to tune the IRModule mod_deploy
.
I guess the mismatch you observed is because both the TIR extraction of tune_relax
and MetaScheduleApplyDatabase
will “normalize” each TIR function, while tune_tir
does not. You can try tune_relax
and see if it works for your case.
from web-stable-diffusion.
Thanks for your reply.
I've tried this, but sadly, it still cannot work. Following your advice, I've changed my configuration as follows:
def do_all_tune(mod, target):
tunning_dir = "gpu3090_workdir"
tunning_record = "gpu3090/database_tuning_record.json"
tunning_workload = "gpu3090/database_workload.json"
cooldown_interval = 0
trial_cnt = 100
trial_per = 2
local_runner = ms.runner.LocalRunner(cooldown_sec=cooldown_interval, timeout_sec=60)
database = ms.relax_integration.tune_relax(
mod=mod,
target=target,
work_dir=tunning_dir,
max_trials_global=trial_cnt,
max_trials_per_task=trial_per,
runner=local_runner,
params={},
)
if os.path.exists(tunning_record):
os.remove(tunning_record)
if os.path.exists(tunning_workload):
os.remove(tunning_workload)
database.dump_pruned(
ms.database.JSONDatabase(
path_workload=tunning_workload,
path_tuning_record=tunning_record,
)
)
Still saying #43 (comment).
I wonder if it is relavent to the max_trials_global
and max_trials_per_task
option.
from web-stable-diffusion.
I wonder if it is relevent to the
max_trials_global
andmax_trials_per_task
option.
Yes, it is relevant. For 10000 and 2000 for trial_cnt and trial_per, only the take
operator is wrong.
from web-stable-diffusion.
Thanks @Civitasv! Glad that it works :-)
from web-stable-diffusion.
Related Issues (20)
- [bug] "ms.database.create(work_dir=args.db_path)", JSONReader: cannot find field purity HOT 2
- Can I auto-tunning SD models by myself? HOT 2
- Update stable diffusion log_db (database) for the newly introduced purity flag HOT 5
- Is there a way to set/change the seed in runtime? HOT 1
- assert len(mod.functions) == 1 error HOT 2
- How to use fp16 precison version of Stable Diffusion 1.5? HOT 1
- Huge performance gap between TVM and TRT on Stable Diffusion v1.5 HOT 1
- The operation failed for an operation-specific reason HOT 1
- Not an issue but request
- Support SDXL 1.0 Model HOT 6
- Jupyter walkthrough trace_models
- AssertionError: Unsupported function type position_ids HOT 8
- Support Stable Video Diffusion
- ValueError: Multiple tensors as index not yet supported HOT 3
- Feature request: FP16 Support
- Assistance Required with tvmjs Integration and webgpu.get_fmap Error HOT 10
- Quality of the image is poor. HOT 3
- TVMError: Check failed: (!name_supply_->ContainsName(global_symbol_value)) is false: IRModule contains duplicate global symbol: main HOT 11
- Check failed: kNumAttrs == attrs.size() (2 vs. 1) : ValueError: Incorrect kNumAttrs for instruction: Split HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-stable-diffusion.