I can’t reproduce your results, in my configuration I obtain:
numpy: 3.5303005139999186 (without torch.FloatTensor initialisation)
torch: 2.5097883099999763
However, torch’s generator is still faster. If you are curious, you can compare the source implementation of poth libraries:
As far as I know, torch.rand is using THRandom.c:

  
      github.com
  
  
    torch/TH/blob/master/THRandom.c 21
#include "THGeneral.h"
#include "THRandom.h"

#ifndef _WIN32
#include <fcntl.h>
#include <unistd.h>
#endif

/* Code for the Mersenne Twister random generator.... */
#define n _MERSENNE_STATE_N
#define m _MERSENNE_STATE_M

/* Creates (unseeded) new generator*/
static THGenerator* THGenerator_newUnseeded()
{
  THGenerator *self = THAlloc(sizeof(THGenerator));
  memset(self, 0, sizeof(THGenerator));
  self->left = 1;
  self->seeded = 0;
  self->normal_is_valid = 0;


  This file has been truncated. show original

  
  
    
    
  
  


And numpy.random.rand, I think it is based on:

  
      github.com
  
  
    numpy/numpy/blob/master/numpy/random/mtrand/initarray.c 16
/*
 * These function have been adapted from Python 2.4.1's _randommodule.c
 *
 * The following changes have been made to it in 2005 by Robert Kern:
 *
 *   * init_by_array has been declared extern, has a void return, and uses the
 *     rk_state structure to hold its data.
 *
 *  The original file has the following verbatim comments:
 *
 *  ------------------------------------------------------------------
 *  The code in this module was based on a download from:
 *     http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html
 *
 *  It was modified in 2002 by Raymond Hettinger as follows:
 *
 *   * the principal computational lines untouched except for tabbing.
 *
 *   * renamed genrand_res53() to random_random() and wrapped
 *     in python calling/return code.


  This file has been truncated. show original