This project is mirrored from Pull mirroring failed .
Last successful update .
  1. 05 Nov, 2020 1 commit
    • Michael Reneer's avatar
      Fix PY 3.8 warning about using ABCs from `collections`. · c40e3083
      Michael Reneer authored
      Do not use or import the ABCs from `collections`, this is deprecated since Python 3.3, and in 3.9 it will stop working. These ABCs have moved to '' and should be used from this package.
      PiperOrigin-RevId: 340678321
  2. 23 Oct, 2020 1 commit
    • Taylor Cramer's avatar
      Add initial compilation to/from `BroadcastForm` · 1066f350
      Taylor Cramer authored
      This also cleans up some other shared functionlity
      in form_utils and clarifies the ordering of
      (context_from_server, client_data) parameters in
      both broadcast-form-able computations and in
      `BroadcastForm.client_processing`. This aligns
      with `IterativeProcess`, but does not match `work`.
      PiperOrigin-RevId: 338553479
  3. 17 Oct, 2020 1 commit
  4. 19 Aug, 2020 1 commit
  5. 24 Jul, 2020 1 commit
  6. 22 Jul, 2020 1 commit
    • Taylor Cramer's avatar
      Rename `AnonymousTuple` to `Struct`. · d12deec7
      Taylor Cramer authored
      This change moves and renames `AnonymousTuple` and its `Type`-based
      brethren. It re-exports the new types under the old names to allow
      for a more gradual transition to the new API.
      PiperOrigin-RevId: 322477504
  7. 18 Jul, 2020 1 commit
    • Taylor Cramer's avatar
      Propagate container_type and include it in type equality checks. · 4ed574ab
      Taylor Cramer authored
      Previously, NamedTupleTypeWithPyContainerType was often lost and turned into
      a NamedTupleType without the container. This resulted in users being given
      AnonymousTuples when a more specific container should have been returned.
      This change fixes a large number of sites where container types were lost, and
      adjusts usage sites as appropriate, including the removal of `from_tff_result`
      This change also makes the `__eq__` function for
      `NamedTupleTypeWithPyContainerType` require equivalent container types, rather
      than just equivalent field structure. Call sites that wished to compare only
      field structure are adjusted to use `Type.{is, check}_equivalent_to`.
      PiperOrigin-RevId: 321883012
  8. 24 Jun, 2020 1 commit
  9. 23 Jun, 2020 1 commit
    • Taylor Cramer's avatar
      Modifications from profiling, including removal of `isinstance` casing · 91dd2a0e
      Taylor Cramer authored
      These are modifications I made in order to speed up the workload timing
      out in serialization + deserialization in b/156371202. I intend to follow
      it with a change to intern types, whose serialization, deserialization, and
      comparison is currently causing exponential blowups due to the nested
      structure of type signatures and the frequency with which they occur
      throughout the AST (one full copy per node).
      The biggest change in this CL comes from the move away from using
      `isinstance` to case over AST blocks and type nodes. This change was motivated
      by a few factors:
      - It's significantly faster (a single method lookup vs. type tree traversal).
      - It clarifies which `isinstance` checks are dynamic Python "downcasts" vs.
        "switch"es on a kind of sum-type. The downcast-like spots are in my opinion
        more suspect and should be subject to a decent bit of scrutiny when added,
        while switches on a sum-type should not be cause for concern.
      - I personally find it more ergonomic and easier to read:
        `my_structure.is_lambda()` vs.
        `isinstance(my_structure, computation_types.Lambda)`
      Some other performance-motivated changes included here are:
      - Caching the list-of-tuples representation of AnonymousTuples.
      - Moving formatting of error messages out of the success path.
      - Removing the `are_equivalent_types` check on building blocks
        which ensured that the deserialized type of a building block
        matched the type of the deserialized building block. This
        check isn't exactly redundant, but given correct serialization
        and deserialization it will never trigger, and it is extremely
        expensive (expontentially complex). This may be worth looking
        into reenabling once I've landed a change to intern Types.
      - Removing the `check_well_formed` on building blocks __init__.
        This is similar to the above in that it should be unnecessary
        given correct TFF code, and is extremely expensive. As above,
        it may be worth trying to enable when we start interning types.
      - I did *not* disable the `is_concrete_instance_of` check on
        the `Intrinsic` building block, which is also quite expensive.
        I think this one is rather higher-value than the two above,
        but this is totally a judgement call as they are all quite
        costly and scale exponentially in time with the depth of the
        type tree. This should also hopefully be much cheaper once
        we have type interning.
      - Moving the type tree visitor to internal iteration.
        I did not do the same for the building block visitor yet, since
        it has more visitors of varied shape and complexity, but I think
        this is worth investigating in the future.
      PiperOrigin-RevId: 317769828
  10. 28 May, 2020 1 commit
  11. 27 May, 2020 1 commit
  12. 08 May, 2020 2 commits
  13. 10 Mar, 2020 1 commit
    • Scott Wegner's avatar
      Support dict-like syntax for extracting values from AnonymousTuple by key. · ef39a39e
      Scott Wegner authored
      This is a convenience for working with the output of a federated computation, which is generally returned as a nested AnonymousTuple structure. Now, individual values can be extracted from the structure using:
        result = my_federated_computation()
      This was previously possible using `getattr(result, 'foo')`; this change makes the existing functionality more discoverable.
      PiperOrigin-RevId: 299964819
  14. 08 Feb, 2020 1 commit
    • Taylor Cramer's avatar
      Add intrinsic federated_eval · f3694f0a
      Taylor Cramer authored
      This intrinsic is similar to federated_value, but accepts a no-argument lambda
      rather than an unplaced value. This will clarify the behavior of the intrinsic
      (eval on all clients separately rather than eval and then broadcast), and
      unblocks the effort to ban unplaced values.
      PiperOrigin-RevId: 293898477
  15. 03 Jan, 2020 1 commit
  16. 31 Dec, 2019 2 commits
  17. 18 Dec, 2019 2 commits
  18. 16 Nov, 2019 2 commits
  19. 15 Nov, 2019 1 commit
  20. 17 Oct, 2019 1 commit
  21. 21 Sep, 2019 1 commit
  22. 12 Sep, 2019 1 commit
    • Keith Rush's avatar
      Adds iter_elements module function to anonymous_tuple. · a82c3187
      Keith Rush authored
      Generates the elements of the tuple in sequence instead of pulling the entire thing into a list.
      Also replaces any instances of immediate iteration over the elements with iterating over the generator instead.
      PiperOrigin-RevId: 268550273
  23. 07 Sep, 2019 1 commit
    • Keith Rush's avatar
      Moves hash function and equality of anonymous tuple to use newly added name_array. · f2ac433c
      Keith Rush authored
      Previously, equality was checked by equality of name_to_index dict (IE equality as dicts, as unordered sets of key-value pairs), while hash was generated by iterating over the dict (where order matters).
      Since dicts are unordered, it is an implementation detail of the underlying Python whether equality as AnonymousTuples then implies equality of hashes. This is not quite in line with the python spec of hash, which states that objects which compare as equal *must* return the same hash value.
      PiperOrigin-RevId: 267644204
  24. 06 Sep, 2019 1 commit
  25. 29 Aug, 2019 1 commit
  26. 23 Aug, 2019 1 commit
  27. 20 Aug, 2019 1 commit
  28. 16 Aug, 2019 1 commit
  29. 02 Aug, 2019 1 commit
  30. 24 May, 2019 1 commit
  31. 16 May, 2019 1 commit
  32. 15 May, 2019 1 commit
  33. 14 May, 2019 1 commit
  34. 13 May, 2019 1 commit
  35. 11 May, 2019 1 commit
  36. 10 May, 2019 1 commit