The Attribute generic.attackSpeed will not work. If I e.g. give myself one with an Amount of 1.6 (which should be exactly as fast as a default sword), you can spam-click it, the value does not seem to change anything.
Here are the commands used:
1.12.2
/give @s minecraft:diamond_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:1.6,Operation:0,UUIDLeast:886938,UUIDMost:310468,Slot:"mainhand"}]}
1.13+
/give @s minecraft:diamond_sword{AttributeModifiers:[{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:1.6,Operation:0,UUIDLeast:886938,UUIDMost:310468,Slot:"mainhand"}]}
This works as intended but the tooltip information is not really helpful in general, see MC-113552.
The player has a base attack speed of 4.0 and the attack speed modifier of a sword is actually -2.4000000953674316, therefore the following sword has the same attack speed like a default sword:
1.13+