cbalint13 commented on PR #17853: URL: https://github.com/apache/tvm/pull/17853#issuecomment-2816773362
@jerryzj To further clarify where this ```vector_width``` ends up: * Targets have different maintainer, having codegen overrides, the original ```vector_width``` is not even used: https://github.com/search?q=repo%3Aapache%2Ftvm%20native_vector_bits_&type=code * The only target that really picks it up is the llvm codegen backend: https://github.com/apache/tvm/blob/36f2502f00d58128451d64c8ff12fa871c994c92/src/target/llvm/codegen_llvm.cc#L176 * In this context, the only place it really propagates is into [GetAlignment()](https://github.com/search?q=repo%3Aapache%2Ftvm+p_native_bits&type=code) , but even here is used as a last resort hint. Up to this point we can say```vector_width != VLEN``` (no such relationship), but also can't set it to 0 (zero). E.g. in case of x86 it is set to maximal 512 (for avx512) but in reality only few server class CPU have such vector feature. Now, in the context of SVE (WiP) it will be really picked up and used to construct a list of ````vscale_range``` hints for arith provers in the SVE predication process. But SVE, in case of riscv, always implies that target have ```v``` extension, and also a minimum default zvl128b flag that will be picked up for sure from LLVM side. In this case ```vector_width == VLEN``` will be true here. This schema also will work for aarch64 SVE predication, the initial hint value of 128 will be used unaltered, this arch doesnt have so fancy flags with direct indicatation on the kind of vector machine. In last instance if someone really want to enforce other initial hint value, (assuming really knowing what is doing) can override even this initial hint using ```-vector-width=xxx``` but this will get override in the case of exact inference from LLVM side (in case of riscv rvv for sure). --- Let's set it to 128 as you hinted as a initial hint value, but this PR here failed to pass testcases otherwise it LGTM. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
