Skip to content

Conversation

@shayne-fletcher
Copy link
Contributor

Summary:
this diff adds an experimental build identity module to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via mapped_srcs. cargo / oss builds do not see it. fbcode builds get a new hyperactor_mesh::build_info module (behind #[cfg(fbcode_build)]) that exposes commit(), timestamp(), user(), and host(). each of those returns a &'static str baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling init() installs BUILD_COMMIT, BUILD_TIMESTAMP, BUILD_USER, and BUILD_HOST into process-wide Attrs via hyperactor::config::global. callsites that only need to compare versions (e.g. host/proc handshake) can read commit() directly. code that wants to surface this via logs or admin endpoints can call init() once and query the global config.

this is buck-only. we do not add a build.rs, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing commit() at startup and warn or fail on mismatch.

Differential Revision: D86009410

@meta-codesync
Copy link

meta-codesync bot commented Nov 1, 2025

@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D86009410.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 1, 2025
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 1, 2025
…-pytorch#1738)

Summary:

this diff adds an experimental build identity module to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 1, 2025
…-pytorch#1738)

Summary:

this diff adds an experimental build identity module to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 1, 2025
…-pytorch#1738)

Summary:

this diff adds an experimental [build identity module](https://www.internalfb.com/phabricator/paste/view/P2018151567) to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 1, 2025
…-pytorch#1738)

Summary:

this diff adds an experimental [build identity module](https://www.internalfb.com/phabricator/paste/view/P2018151567) to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 1, 2025
…-pytorch#1738)

Summary:

this diff adds an experimental [build identity module](https://www.internalfb.com/phabricator/paste/view/P2018151567) to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
…pytorch#1739)

Summary:


pytorch `InputBuffer::add` API changed. adapt `monarch/python/monarch/_gradient_generator.cpp`
```
  realInputBuffer(node).add(
      input_nr,
      check_and_reduce(node->node, input_nr, std::move(t)),
      std::nullopt,
      std::nullopt);  // Remove: node->node
```

that gradient computation still works correctly after this change needs to be tested.

Reviewed By: vidhyav

Differential Revision: D86025607
…-pytorch#1738)

Summary:

this diff adds an experimental [build identity module](https://www.internalfb.com/phabricator/paste/view/P2018151567) to hyperactor_mesh.

at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.

the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.

this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.

rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.

Differential Revision: D86009410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant