US Congress has passed a sweeping legislation that would decriminalize marijuana at the federal level.