Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pytorch] Specialize guts of c10::optional for 32-bit scalars #47015

Closed
wants to merge 8 commits into from

Commits on Oct 28, 2020

  1. [Pytorch] Specialize guts of c10::optional for 32-bit scalars

    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    aa5b457 View commit details
    Browse the repository at this point in the history
  2. add missing bracket on "[Pytorch] Specialize guts of c10::optional fo…

    …r 32-bit scalars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    1ca7ce3 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2020

  1. add missing #include <array> on "[Pytorch] Specialize guts of c10::op…

    …tional for 32-bit scalars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    3dd5032 View commit details
    Browse the repository at this point in the history
  2. Update on "[Pytorch] Specialize guts of c10::optional for 32-bit scal…

    …ars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    5465721 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2020

  1. Update on "[Pytorch] Specialize guts of c10::optional for 32-bit scal…

    …ars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    bee5230 View commit details
    Browse the repository at this point in the history
  2. add extra checks for windows on "[Pytorch] Specialize guts of c10::op…

    …tional for 32-bit scalars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    9fb93b6 View commit details
    Browse the repository at this point in the history
  3. add more specific checks back in in hopes of pacifying Windows builds…

    … on "[Pytorch] Specialize guts of c10::optional for 32-bit scalars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    e149edc View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2020

  1. stop using std::is_trivially_copyable in Optional.cpp on "[Pytorch] S…

    …pecialize guts of c10::optional for 32-bit scalars"
    
    c10::optional has non-trivial copy and move operations always. This change specializes it for 32-bit scalars so that it has trivial copy and move operations in that case. Ideally, we would instead rely on P0602 "variant and optional should propagate copy/move triviality" and use `std::optional` (or implement that functionality ourselves). We can't use `std::optional` because we are stuck with C++14. Implementing the full P0602 ourselves would add even more complexity. We could do it, but this should be a helpful first step.
    
    Differential Revision: [D24552280](https://our.internmc.facebook.com/intern/diff/D24552280/)
    
    [ghstack-poisoned]
    swolchok committed Nov 4, 2020
    Configuration menu
    Copy the full SHA
    c6d8a51 View commit details
    Browse the repository at this point in the history