XNNPACK icon indicating copy to clipboard operation
XNNPACK copied to clipboard

Move Config Srcs into build_srcs.bzl

Open mcr229 opened this issue 6 months ago • 7 comments

Light refactoring to move config srcs into build_srcs.bzl

mcr229 avatar Jun 24 '25 23:06 mcr229

@dsharletg

mcr229 avatar Jun 24 '25 23:06 mcr229

Seems like the issue was that src/pack-lh.cc actually uses the unary_elementwise_config and reduce_config. So i kept those around and but those as deps for pack_lh. I removed all others and joined them into microkernel_configs.

@gonnet @dsharlet

mcr229 avatar Jul 01 '25 01:07 mcr229

What is the purpose of removing the granular targets in src/configs/BUILD?

I'm asking because I only recently split these out because it's best practices to have as granular targets as possible (see e.g. here).

gonnet avatar Jul 01 '25 07:07 gonnet

I've sent https://github.com/google/XNNPACK/pull/8664 which should eliminate the special case requirements of pack-lh, which would enable this PR to work as it was originally sent.

If sharing the BUILD becomes easier due to this change (a single BUILD target with a variable for the config srcs), then I don't think we should worry about bazel's guidelines @mcr229.

dsharlet avatar Jul 01 '25 17:07 dsharlet

@mcr229 I'm still confused about the intent of this change. If you need the list of config files, it's just the source files in XNNPACK/src/configs/.

The granular targets were part of an ongoing larger refactoring trying to put things in specific subdirectories to avoid having to have lists of sources (subgraph and operators were going to be next, but blocked on some dependency issues).

gonnet avatar Jul 01 '25 18:07 gonnet

@gonnet I didn't know that separating these build targets was an active effort. Honestly the level of separation of all MICROKERNEL_CONFIG srcs living in src/configs, all OPERATOR_SRCS living in src/operators, etc. makes sense and that level of organization could be leveraged by our build system to scrape the srcs from the appropriate directory. I'm ok with dropping this PR if that is the intent.

mcr229 avatar Jul 01 '25 19:07 mcr229

@mcr229 That is fortunately almost already the current state, and I have an open Issue to clean things up. If it makes your build process simpler and/or easier to manage, I can prioritize wrapping up this work and get your feedback on the changes.

gonnet avatar Jul 01 '25 20:07 gonnet