Revert "Revert "move weight to the front end""

This reverts commit 69b32e98b334b05d4d6b2902d830f91dd01b313a.