Egregoros

Signal feed

Timeline

Post

Remote status

Context

25

@DavidB@noauthority.social @thecsb@mastodon.cloud the training process "translates" the training data into optimized weights using gradient decent and back propagation in the same way a compiler "translates" source code using parsing lexing building an AST, transforming the AST to IR, IR is optimized, IR is transformed into machine code.

both are "translating" and "compressing" fat enriched source data into a thin opaque binary output in a one way manner.

@jeff @thecsb if you give the compiler the same inputs, including flags, you will get the same out.

In the situation you're describing the inputs are being changed on each run. You can think of a compiler as a function. And your source code is not the only input.

Some compilers make controlling inputs impossible, thus you can't get a bit-for-bit binary that's identical for each compiler run.

Compilers are deterministic. For a given set of inputs you will get the same output.

We need a single threaded KVM implementation that is reproducible. And probably also should be able to create a log of inputs, so you can launch a VM and fiddle around in it, then when you hit a bug, you can re-launch and replay the same inputs and arrive at the same state.

There's only two devices that you NEED and that are going to generate interrupts.
1. Disk drive -> Do the easy thing, pause the VM until the disk replies so to the VM it's synchronous.
2. Clock -> Like I said, this is the fiddly part.

The other device you probably want is an output-only serial console, but since it's one-way it should never generate an interrupt.
Oh yeah I forgot about page faults, that's an "exception" but not a normal numbered interrupt. Should be okay though b/c single threaded and you don't have to wonder when it's going to come, it comes immediately when you touch the page. Same with the FPU, it kicks back an exception immediately when you divide by zero or whatever.

The key is to make sure the clock lies so that you're not able to time any of these things...

Replies

5
The CPU is supposed to guarantee that a single thread will see the world exactly as it left it at any given time - and AFAIK they're all pretty much perfect at this. Where you get a can of worms is when multiple threads are touching each others' memory.

The way the fake clock needs to work is basically when you power on it's T0 and you add a nanosecond for every instruction executed. Then when it schedules and idles the processor, when it re-awakens, the clock is set to whatever time it was scheduled to re-awaken and it goes on again adding a nanosecond per instruction.
What I just described would definitely work, because it's realistic that a real clock could do precisely that.

Just imagine a single core processor where every instruction takes the same number of cycles and every time you set a clock event, it triggers precisely when you asked it to.